Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about kv

KV: a remote KVM application

I had been read­ing about re­mote KVMs for a while. There are sev­er­al, like PiKVM, JetKVM, etc. I de­cid­ed I want­ed one to ac­cess my serv­er at home be­cause it has a nasty ten­den­cy to lose net­work con­nec­tiv­i­ty, and I want­ed to be able to fix it with­out hav­ing to go to the of­fice and plug in stuff in­to it.

This is not like run­ning RDP or VNC on the serv­er in that to the serv­er this is hard­ware. It works no mat­ter how crashed or dis­con­nect­ed the serv­er is, as long as it has pow­er. It is like hav­ing a mon­i­tor, key­board and mouse plugged in to the server, but re­mote­ly.

I had all the hard­ware I need­ed:

  • A Radxa Ze­ro, which has OTG sup­port so I could use it as a USB de­vice.
  • A USB cap­ture don­gle, which are cheap and easy to find, to cap­ture the HD­MI out­put of the serv­er.

But I just could not make it work. PiKVM, the most pop­u­lar one, makes it pret­ty dif­fi­cult to make it work on any­thing oth­er than the ex­act hard­ware con­figs they sup­port, and those are ex­act­ly the ones I don't have.

I could not find any im­ple­men­ta­tion that was easy to set­up and sup­port­ed the hard­ware I had, so I de­cid­ed to write my own.

You can get the code at GitHub of course. It com­piles to a sin­gle bi­na­ry. It on­ly re­quires you to have ffm­peg in­stalled, and it should just work as long as your hard­ware sup­ports OT­G, you have a USB cap­ture don­gle, and you plug all the ca­bles cor­rect­ly.

One USB ca­ble and one HD­MI ca­ble go from the serv­er to the Radxa Ze­ro (the HD­MI via cap­ture don­gle) and you run the one bi­na­ry built from this code on the Radxa Ze­ro. It will start a web serv­er on port 3000, and you can ac­cess it from any brows­er.

The web in­ter­face is very sim­ple, but it work­s. You can see the video feed, and you can send key­board and mouse events to the serv­er. You can even pro­vide a disk im­age that the serv­er will think is a USB drive. I sup­pose you can even in­stall the OS in the serv­er that way, but I have not tried it.

If you want to ac­cess it more re­mote­ly, just set­up a VPN in the KVM it­self.


Contents © 2000-2025 Roberto Alsina