Tuesday, January 7, 2025

PiKVM with Radxa Zero 3E

    My home lab space is very limited so I don't have room for a "spare" monitor mouse and keyboard for my Proxmox host and other projects.  I also don't want to lose access to my PC when I need to trouble shoot so a traditional KVM doesn't sound ideal.  Lately a few new very small external IPKVM solutions have come out but I really wanted to have something more powerful(and more tinker friendly).  After looking over the different KVM projects I settled on PiKVM but don't need any of the advanced features the dedicated HATs provide.  Looking at the DIY options I don't really want to use up a full size Raspberry Pi 4b and using a Raspberry Pi 2w requires using the WiFi due to the single USB controller.  I found the Radxa Zero 3E!  It looks like it has all the required hardware but will it work with PiKVM?  I guess I'm going to find out.

Note on the WiFi version Radxa Zero 3W, much of the same setup should work other than configuring the WiFi and flashing to the EMMC(the 3E doesn't have EMMC).  Honestly for a WiFi version I would stick with a Pi Zero 2w, easier setup and is slightly cheaper.


I made a simple 3D printed case for the Redxa Zero 3E!

https://www.thingiverse.com/thing:6907577


The Hardware

Radaxa Zero 3E

https://radxa.com/products/zeros/zero3e

The specs look good.

  • Hardware MPEG4 Encoding  1080p @ 60hertz
  • MIDI CSI connector (22pin)
  • Onboard 1Gbps Ethernet
  • USB-C OTG support
  • Rockchip RK3566 SoC (4 Arm A55 cores @ 1.6Ghz, over kill for this)
  • 1/2/4/8GB of LPDDR4 (1GB should be fine I got the 2GB incase I reuse this SBC for something else later)

Now to get HDMI in 

Vivitar USB HDMI Capture card

 
I found this at Walmart no information on vendors website looks like rebranded hardware.  Lots of similar looking ones on Amazon/Ebay/AlliExpress, they may also work, I don't know.  I did some testing with this and it just worked.  Plug into the USB-C port closest to the Micro HDMI.  The adaptor says it supports 1080p @60hertz but 30hertz is the best I saw.  Not bad but I'm looking for something with less dongles and adaptors hanging off of it.

The Software

 PiKVM

This is what we will be running.  Unfortunately our hardware choice is not officially supported

Operating system

At the time of me working on this the official Radxa OS is based on Debian 11 and missing a number of the required components from its repositories.  There is also an issue with the CLI only builds not booting.  The Radxa Zero 3E is also not officially supported by Armbian but the community supported build seems to be running fine for what we need here.

https://www.armbian.com/radxa-zero-3/

  • Downloaded the minimal/IOT build
  • Flash to SDCARD, use what ever you are comfortable with I used Etcher



On first boot there is a nice little wizard to walk you through changing the root password and creating a user.

  • login change root password
  • create account

SSH is enabled be default and the user we created after login has access so I will be using SSH, from here on out use witch ever is most convenient for you.

Install KVMD-Armbian

By using the community build of Armbian we can take advantage of some amazing work done by Srepac in creating an install script to get PiKVM running on non Raspberry devices.  Check out their GetHub to see other devices that the install script has been tested on.

Now we are going to go over to Srepac's GitHub repository and use the install script for kvmd-armbian.

https://github.com/srepac/kvmd-armbian

This will take awhile depending on how fast your SDCARD is.

sudo apt update && sudo apt upgrade -y
sudo apt install -y git vim make python3-dev gcc xz-utils wget
cd ~
git clone https://github.com/srepac/kvmd-armbian.git
cd kvmd-armbian
sudo bash ./install.sh

Now we need to reboot our device and then rerun the install script.

cd ~/kvmd-armbian
sudo bash ./install.sh

Before we login and test our new IPKVM let's change the default password for the user "admin"

sudo kvmd-htpasswd set admin


From the GitHub there is also some updates we can install.(optional)

cd ~/kvmd-armbian
sudo wget --no-check-certificate -O /usr/local/bin/update-rpikvm.sh http://148.135.104.55/RPiKVM/update-rpikvm.sh
sudo bash update-rpikvm.sh


Enable Mass Storage

This will allow us to mount storage from the PiKVM for things like OS installs.  What we can use for storage is pretty much limited to what we can mount on the device, it just can't be the root partition.  We could use a USB dive or NFS file share but this device don't have extra USB ports and I want it as self contained as possible so we are going to use a loop back file system.  If you want to use something else it needs to be mounted to /var/lib/kvmd/msd and skip the create-flash-msd.sh script. 

In Srepac's GitHub that we cloned are some tools to make this very easy.  First we need to create a diosk image to use as storage space.  Any ISOs or disk images you upload to the PiKVM will have to fit in this space, so give it plenty of space.
cd ~/kvmd-armbian
sudo bash ./create-flash-msd.sh

Now lets mount the image we just created
sudo systemctl daemon-reload
sudo mount /var/lib/kvmd/msd

Now the reis another script to run that will apply a patch to our PiKVM and enable the Mass Storage options. This won't work if the image is not created and mounted.

sudo bash ./apply-msd-patch.sh -f

Finally!

So how does it work?

Running a YouTube video on the remote host to generate change.  Solid 30hertz, low CPU use and under 200MB of ram in use.  Hardware encoding appears to work, this thing doesn't break a sweat.





No comments:

Post a Comment

UniFi Network force DNS over TLS network wide

The post on doing this in OPNSense has been pretty popular so let's do this with UniFi!  You will need a UniFi gateway and the Network a...