PiKVM

pikvm.org

🌐 Resources 🔗


RPi 4 PiKVM V2 DIY

🔬 Hardware

Raspberry Pi 4 board with 16GB MicroSD card.

  • PiKVM SD card image used is the one For HDMI-USB dongle (or For HDMI-CSI bridge) - download here and flash the MicroSD card with RPi Imager tool

  • RPi4 Power consumption ranging from 2.7W to 6.4W depending on the workload

For power supply and USB connectivity, I have chosen the "Variant #2: Power supply + Y-splitter based on power blocker" from the PiKVM v2 guide with:

  • x1 Raspberry Pi Official USB-C Power Supply

  • x1 USB C splitter (male->double females)

  • x1 USB-A to USB-C cable (male-male)

    • 📌 as power blocker for the VCC of the USB-A male connector that goes into the PC/NAS, I've used a small piece of tape over the right-most pin on the connector to block the 5V pin

Similar diagram as my setup:

USB Connections - Credit: Tom's Hardware

The "USB C to Double USB C Splitter" used:

For the video capture device I've used an HDMI-USB dongle for my testing lab (change with a HDMI-CSI bridge board later).

Anyway, a HDMI-CSI bridge board is better for video encoding, resolution and latency.

Check Geekworm models here, and Amazon links:

On-boot configuration

Setup WiFi SSID & Password if necessary in the pikvm.txt file from the SD Card (on another PC), by adding the following variables:

WIFI_ESSID='mynet'
WIFI_PASSWD='p@s$$w0rd'
# On Windows PS - get WiFi config with
netsh wlan show profiles | Select-String "All User Profile" | ForEach-Object { $_.ToString().Split(':')[1].Trim() } | ForEach-Object { $p = $_; $out = netsh wlan show profile name="$p" key=clear; $pw = ($out | Select-String 'Key Content' | ForEach-Object { ($_ -split ':')[1].Trim() }) -join ''; [PSCustomObject]@{Profile=$p;Password=($pw -ne '' ? $pw : '(none)')} } | Format-Table -AutoSize

PiKVM Shell commands

Authentication

su - 
# use "root" as password

# Commands [root@pikvm ~]#

# Change Linux "root" password
rw
passwd root

# Change web access "admin" password
kvmd-htpasswd set admin
ro

# Update system
pikvm-update
# or
rw
pacman -Syy
pacman -S pikvm-os-updater
pikvm-update
[root@pikvm ~]# cat /etc/os-release
NAME="Arch Linux ARM"

Wake-on-LAN

rw
nano /etc/kvmd/override.yaml
  • (Extra) Disable "ATX" menu

kvmd:
    atx:
        type: disabled
  • Configuration for single device WoL

###############
# Wake-ON-LAN #
###############

kvmd:
    wol:
        mac: FF:FF:FF:FF:FF:FF # change this to desired MAC Address
kvmd -m # syntax check
systemctl restart kvmd
###############
# Wake-ON-LAN #
###############
kvmd:
	[...]
    wol:
        mac: FF:FF:FF:FF:FF:FF
    gpio:
        drivers:
            proxmox-asus:
                type: wol
                mac: FF:FF:FF:FF:FF:FF
            proxmox-k8:
                type: wol
                mac: FF:FF:FF:FF:FF:FF
            truenas:
                type: wol
                mac: FF:FF:FF:FF:FF:FF
        scheme:
            proxmox-asus:
                driver: proxmox-asus
                pin: 0
                mode: output
                switch: false
            proxmox-k8:
                driver: proxmox-k8
                pin: 0
                mode: output
                switch: false
            truenas:
                driver: truenas
                pin: 0
                mode: output
                switch: false
        view:
            table:
                - ["#1. Proxmox-K8", "proxmox-k8|Wake-on-LAN"]
                - ["#2. Proxmox-Asus", "proxmox-asus|Wake-on-LAN"]
                - ["#3. TrueNAS", "truenas|Wake-on-LAN"]
kvmd -m # syntax check
systemctl restart kvmd
reboot

Mass Storage Drive

Insert the USB into an RPi USB3 port.

Open the PiKVM Terminal/Shell. Use the following procedure.

  • Identify the USB drive and its filesystem type using, ensuring it's recognized (e.g., exfat for Ventoy)

  • Add a mount entry in /etc/fstab to automatically mount the USB drive at boot, with read/write access and permissive permissions

  • Ensure the mount point exists and is writable, using mkdir, kvmd-helper-otgmsd-remount, or mount -o remount,rw as needed

  • Manually mount or reboot the system to apply changes, allowing access to the USB contents under /var/lib/kvmd/msd/usb

su -
rw

# Check USB drive presence and FS type
lsblk -f
# e.g. Ventoy thumb drive
    sda
    |-sda1      exfat  1.0   Ventoy  4E21-0000
    `-sda2      vfat   FAT16 VTOYEFI 626B-4255

# Add mount entry
nano /etc/fstab

# Add the following line at the end of the file
# This says to mount it automatically, do not fail if it's missing, mount it read/write by default, and allow all users and groups access to it
/dev/sda1   /var/lib/kvmd/msd/usb   exfat  auto,nofail,rw,umask=0000  0 0

# Make the filesystem Read/Write
kvmd-helper-otgmsd-remount
# If this is not working, mount the /var/lib/kvmd/msd manually as following
mount -o remount,rw /var/lib/kvmd/msd

# Create dedicated mounting directory
mkdir -p /var/lib/kvmd/msd/usb
kvmd-helper-otgmsd-remount ro

# Reboot PiKVM or mount manually for testing
mount /var/lib/kvmd/msd/usb

ll /var/lib/kvmd/msd/usb
df -hT
	/dev/sda1      exfat      58G   52G  5.5G  91% /var/lib/kvmd/msd/usb

Tailscale on PiKVM

# Tailscale
pikvm-update
rw

pacman -S tailscale-pikvm
systemctl enable --now tailscaled
tailscale up

reboot

ip addr show tailscale0

Last updated

Was this helpful?