I was kinda getting tired of manually moving my keyboard and screen from one server to the other to check stuff, so yesterday I decided to build my own KVM switch. Most of the times I’m not typing from the actual systems, but use Putty to connect remotely from my PC, instead. However, when I do have to use the server-side keyboard and screen, it’s a pain in the ass to move the cables from one server to the other, awfully annoying and extremely time consuming. I was planning to do this for a long time, but I always postponed it, until I thought “well, enough is enough, I’ll do this TODAY”.
The approach was very simplistic. I only used a bunch of relays, and that is all there is to it. 9 relays, to be exact. I had 6 simple, single-contact relays lying around, I used those for the video RGB signals (3 color signals, each with it’s own ground, so 2×3). Then I needed 6 other wires to be switched, 2 video synchronization signals for the display (horizontal and vertical sync) and 4 wires for the keyboard. Theoretically, you would need only 2 of them to be switched for the keyboard, as the other 2 are only power connections (+5V and GND), but I wanted to be sure it works, so I switched all 4 wires of the keyboard. I used 3 extra relays, this time double-contact, one of them for the 2 sync signals for the video, and 2 more for the 4 wires of the keyboard.
I power it up using an old cell phone charger, and do the switching using a power supply on/off button that I mounted on the display:
The green connector you see is actually used for one of the keyboard ports. Remember kids, this is a linux environment and we don’t need a mouse. Real men don’t click.
It looks nothing like the beast at the beginning of the article, but it’s simple, cheap (did it for around 5$), and it works. I don’t really consider a diagram would be of any help, as this is the simplest thing you can possibly imagine. It’s just a bunch of relays all powered up together, switching from one side to the other. I think the picture with the board will be enough. It is actually more difficult to prep all the cables and connectors, figure which wire is which etc.