The home server lives in a cupboard under the stairs, which is fine right up until it doesn't boot and the only way to see why is to drag a monitor and keyboard into a space designed for a hoover. I have done this enough times to resent it. Commercial KVM-over-IP boxes exist and they are very good, but the decent ones start around the price of the server they're babysitting, and that felt absurd for a machine that misbehaves perhaps twice a year.
So I built one. A Raspberry Pi, a cheap HDMI capture stick, a USB OTG cable, and an afternoon. The result is a thing that gives me the full BIOS, the boot menu, and a keyboard, all in a browser, from anywhere. It cost about a tenth of the commercial option and taught me more than I expected.
The shopping list
The bill of materials is short and almost all of it was already in a drawer:
- A Raspberry Pi 4 (2GB is plenty)
- A USB HDMI capture dongle, the £15 sort based on the MS2109 chip
- A USB-A to USB-C cable for the OTG gadget side
- An HDMI cable from the server to the capture stick
- A relay board, for the power and reset buttons, which is where the soldering came in
I went with PiKVM as the software because someone has already solved every problem I was about to discover for myself. You can build the whole thing by hand with ustreamer and a pile of scripts, and I started down that road out of stubbornness, but PiKVM packages the video pipeline, the virtual keyboard and mouse, the mass-storage emulation and a sane web UI, and I had no good reason to reinvent it.
Video in, USB out
The clever bit of any KVM like this is that the Pi pretends to be two different things at once. On one side it's a video sink: the capture dongle ingests the server's HDMI output and presents it as a plain old webcam device, /dev/video0, which ustreamer turns into an MJPEG stream you watch in the browser. On the other side the Pi's USB-C port runs in gadget mode, so to the server it looks like a keyboard and mouse plugged into a USB port. The server has no idea any of this is a Pi. It thinks someone is standing in the cupboard typing.
The capture stick is the part that surprised me. The MS2109 chips are gloriously cheap and mostly cap out at 1080p30 or thereabouts, and some of the listings lie cheerfully about their capabilities. The one I got reported a YUYV mode it couldn't actually sustain and fell over into a green smear under load. Forcing MJPEG and dropping to 1280x720 fixed it instantly, and for reading a BIOS screen 720p is more than enough. You're not colour-grading a film, you're squinting at memory timings.
Getting the Pi into gadget mode is the usual dance of enabling the dwc2 overlay and the right modules. PiKVM does most of this for you, but the principle is worth knowing because it's the same trick behind a dozen other Pi projects. The OTG cable carries both data and, if you're not careful, power, and back-powering the Pi from the server is a good way to get confusing brownout behaviour. I cut the power line on the OTG side, which is crude but effective.
The soldering, finally
Video and keyboard get you most of the way, but the whole point was the times the machine won't boot, and for those I want the power button. That meant tapping the motherboard's front-panel header: the two pins the case power switch shorts together to wake the board. A relay board lets the Pi do exactly that, momentarily closing the circuit on a GPIO command. Same again for reset.
The soldering was modest and I still managed to make it interesting. The front-panel header is 2.54mm pitch, which is forgiving, but the relay board's screw terminals wanted tinned wire ends and my first two attempts produced cold joints that worked on the bench and not in the case. The tell was a relay that clicked but didn't always close. Reflowing both joints properly, with the iron actually up to temperature rather than "warm enough, probably", sorted it. A multimeter in continuity mode is the only honest judge of whether you've made a connection or just a hopeful blob.
I wired the relay's common and normally-open contacts across the power pins, leaving the physical case button still in parallel so I didn't lose the ability to press it by hand. Both paths short the same two pins, so they coexist happily. A short GPIO pulse, a satisfying click, and the server in the cupboard powers on while I sit on the sofa.
Was it worth it
Honestly, yes, and not only for the money. The first time the server hung on a kernel update and I watched the panic scroll past in a browser tab, then power-cycled it and caught the boot menu, all without standing up, I felt the specific smugness of a problem solved properly rather than endured. There's a wider point too. The components that make this possible, USB gadget mode, cheap UVC capture, a relay and a GPIO pin, are not exotic. They're the same primitives behind a lot of "expensive appliance" categories, and once you've built one you stop being quite so willing to pay for the boxed version.
The honest caveats: the latency is fine for typing and reading but you would not enjoy gaming over it, the capture sticks are a lottery, and if you want secure boot with a real Trusted Platform Module attesting your remote console you are firmly back in commercial territory. For a home lab, none of that matters. For the cupboard under the stairs, it's perfect.