Show HN: Multi-monitor KVM using just a USB switch (github.com)
Simple KVM lets you control multiple PCs from one mouse, keyboard and monitor(s).
It is similar to Haimgel's display-switch (https://news.ycombinator.com/item?id=29608967), but it provides a GUI which hopefully makes it a bit easier to set up. It also supports hotkeys which effectively lets you alt+tab between computers.
I was surprised by the star-to-download ratio (55:400) on GitHub, so I thought I'd post it here as it might be useful to someone.
Feedback welcome!
Thanks, Fidel
188 comments
[ 2.9 ms ] story [ 230 ms ] threadThe benefit of SimpleKVM is that I just have to run it on my home PC, and I can switch between work and home.
At least one of the computers must be on and running Windows, but maybe only one?
If it detects the USB device being inserted, it changes monitor inputs to the Windows computer. If it detects the USB device being removed, it changes monitor inputs to the Linux computer.
It's basically a hardware remote-desktop at that point though, so the "KVM" part only applies to the KVM device being connected to another physical device on location.
EDIT: To clarify further, the advantage of this is PiKVM is undetectable by work laptops. Nothing is installed on the work laptop, it's strictly HDMI + USB cables going to the KVM. I know this because I use one for my FAANG job.
The monitor that is suitable for gaming and has high DPI high refresh and built-in KVM switch is Gigabyte M28U, clicking one button switches input source and USB peripherials, works quite nicely, there's also M32U but with less DPI.
HDMI on the other hand typically allows the ddc-commands even on ports that are not the active input.
Not sure if the above must be the case but it has been the case for all displays I've used.
My use case is a bit different. I have two Windows machines and a dual monitor setup. I use NirSoft ControlMyMonitor which has a CLI and a Elgato Stream Deck.
In a normal KVM approach both monitors are showing only one computer. My use case is a bit odd- I want one computer on monitor A and the other on monitor B. I may also want to flip that. I use a portrait and landscape setup. Then I want to be able to switch mouse/keyboard independently of monitor configuration.
Each computer runs the Stream Deck software and the Stream Deck is connected to the USB switch.
The only issue I found was random disconnects when using a backlit LED keyboard and the stream deck on the same non-powered USB switch. I switched to a powered USB switch and that issue is gone.
The switch I'm using is IOgear 2x4 with a USB 5v 2a power brick. https://www.iogear.com/product/GUS402/
https://en.wikipedia.org/wiki/Display_Data_Channel
Or it does but the state of DDC/CI (and HDMI-CEC) is very sad as implementation is inconsistent and subpar to say the least (from order of commands to timing to subtle difference in required payloads that would make the display reject commands).
A dedicated device would cut the GPU out of the equation, but most likely patching ddc tools can be equally fruitful.
In addition to the other links posted, ddcutil.org has some more good info: https://www.ddcutil.com/#introduction
These would go pretty well with this software, maybe I'll give it a try.
Otherwise some KVM that is decent is as you imply not going to be cheap. The one that I have seen recommended on here before is https://www.store.level1techs.com/products/p/14-kvm-switch-d...
The manufacturer themselves even outright says it’s not perfect, but from what I can tell it’s probably the best one on the market right now
Not if you use DP-MST (DisplayPort Multi-Stream Transport, to "daisy-chain" monitors).
Yes I noticed prices had increased a bit over the last couple of years. Perhaps there's a market for yours.
Interesting to hear that some USB switchers don't quite work in Linux. I had assumed they were just very basic USB hubs so no special drivers required. I know some USB switches have fancier things like inter-PC file transfer or mouse sharing like this one (https://www.aliexpress.com/item/1005006202631772.html), and that often requires special software and drivers.
It's as "dumb" as is possible, according to one of the reviews the ports can be a little iffy if you've plugged things into it too many times, but it's still working perfectly for me for my 2x Dell P2419H monitors.
I chose this one due to all the wires being on the back, but I'd also be happy with the one with the remote in the OP's GitHub page.
[1]: https://www.amazon.com/gp/product/B01HV1N674
I have not tried because I am concern with affecting the hardware. Based on your inspiration I just found Thunderbolt KVMs such as [1] and [2].
[1] https://sabrent.com/products/sb-tb4k
[2] https://www.reddit.com/r/Thunderbolt/comments/11gos6n/kvm_sw...
It would probably work if you were okay with the delays.
I use it between a Windows PC & a Macbookpro (Linux version available but I don't have Linux)
Unfortunately I can't install it on my work computer due to policy & VPN.
The benefit of SimpleKVM is that I just have to run it on my home PC, and I can switch between work and home.
- DDC commands for monitor input switching
- USB KVM that has only one button to switch - mine was 25$, there are plenty of models out there
- Stream deck or prebuilt macropads are super expensive (80$+) for what they are - a few buttons. Get a cheap AliExpress macropad, they go for 5-10-15$ and have all kinds of layouts. They are also much smaller, you can get just one, or 2-3-4 buttons. Don't use the crappy software they ship with, there are github projects to program them. https://github.com/rOzzy1987/MacroPad
- FingerBot 16$ (if you already have HomeAssistant, Zigbee+BT it's faster) or Switchbot 28$ (bluetooth, has a bit more delay) to press the USB KVM button.
- Then an AHK switch to watch for keyboard shortcuts, and trigger both the DDC commands and the USB switch button.
It has a few seconds delay, but it's controlled from one source only, and can be also fully triggered remotely.
At the end of the day this is what I would recommend, it is pricey but everyone swears to it: https://www.store.level1techs.com/products/p/14-kvm-switch-d...
With your solution, one needs to install the AHK script on all computers though?
Maybe to add, this is also better than a KVM because it supports any number of display outputs which you can connect between the two devices. It's more practical to use a USB-C dock though.
I ended up mostly giving up because it was a bit janky and I always had something else in more disarray.
Sweet idea on the macropad! I haven't used them before and placement of the USB switch is always a pain.
So I use mechanical USB switches.
for keyboard and mouse, I use two of these:
https://www.amazon.com/dp/B01I0Y3GEE/
They have no extra keyboard/mouse latency, and no weird side effects like boot keys that don't work or modifier keys that are in the wrong state.
Issues I've had before with mouse/keyboard:
- hotkey conflicts
- mac boot keys break (hold down <key> for <some boot function>)
- modifiers stick in wrong state
- weird delays
- combinations with mouse+keyboard break
Pro: you shouldn't have the issues you listed. Con: you'll lose the hot key commands for the KVM.
The other thing is, many KVMs will add a hub between your keyboard/mouse and the system you're connected to. This is convenient because you have just one cable to each system. But sometimes this is a source of incompatibility. I think the hub requires the system to be able to enumerate devices one-level removed, and the enumeration might be the source of delay. It also might be beyond bios-level firmware, which is less capable than many OS usb stacks. I believe this might have been the problem with mac boot keys.
I know a mechanical usb switch is not very elegant, but I find the reliability it adds is worth it to me.
https://en.wikipedia.org/wiki/KVM_switch
TIL KVMs existed before the mouse, which explains the odd order.
It's not perfect especially since the input switching for the display is quite slow but there's leg in hardware kvms too.
https://xpufx.com/posts/hundred-percent-software-kvm-switch/
https://github.com/feschber/lan-mouse
When it detects a USB device being plugged in, it changes the monitor input to this computer. When a USB device is removed, it changes the monitor input to the other computer.
Crappy KVM solutions are easy. Good ones are hard.
[1] https://www.store.level1techs.com/products/hardware (no affiliation)
- https://askubuntu.com/questions/1042641/how-to-set-custom-lo...
- https://support.apple.com/guide/mac-help/set-sleep-and-wake-...
etc
https://www.amazon.com/dp/B083JKDNRJ
I was hopeful and tried using this Monoprice KVM switch (linked below), but it just wasn't worth it in my experience. Despite supporting Display Port 1.4, I could not use my monitor to its full ability with my PC (3440x1400 @165Hz w/ 10 bit color). Dropping the connection when switching inputs was also incredibly annoying; every time I switched away from my Macbook it would go to sleep.
https://www.amazon.com/dp/B093N1DR8Y
I'm happy to switch inputs on both the USB switch and my monitor separately because it's not actually too large of a hassle, and the monitor doesn't "disconnect" when switching video inputs on my monitor so my Macbook doesn't immediately go to sleep.
If anyone is in the market for a KVM switch, consider a USB hub first. You might find yourself satisfied. They're much less of a hassle and cost very little in comparison to a full featured KVM switch.
- Mac goes to sleep
- Gnome will default back the default monitor configuration and move the windows around
They do have a 1.2 DP KVM with EDID emulation, but you loose all the benefits of the 1.4 DP.
Its all on their FAQ forums
https://forum.level1techs.com/t/official-l1techs-kvm-faq-ult...
To favorite the comment click on the time the comment was posted and then on the following page click favorite.
Anyway, it's pricey and picky about compatibility, so it's hard to recommend, but I'm not aware of anything comparable in terms EDID emulation and support for high res/refresh modes.
Edit: Based on a sibling comment, the situation may have changed and there may be comparable ones around!
EDID emulation done right is expensive.
2 years later switched from m1 to m2 and it no longer works well enough (may also be the Sonoma upgrade stil gotta verify that). The devices get disconnected and glitch etc.
Went to check with dell and monitor is "not supported" on macos.
I am at a loss for words.
Disclaimer: meant to be humorous.
Apple also refuses to implement a protocol that allows controlling the brightness and volume of a non-Apple monitor from the keyboard or even macOS itself. It's infuriating. The only monitors it works with are Apple's and the two overpriced Apple-sanctioned LG monitors sold in the Apple Store.
I'm just explaining how it doesn't just work, and that I'm perfectly happy not using their products. My comment was also a correction that it's on Apple, and not Dell, as to why Apple products don't work well with non-Apple devices. This is a tactic that Apple uses to try and denigrate non-Apple products and get people to come back to Apple's "premium" versions of those products.
There are clear and easy steps Apple could take, but they won't.
That's the one justification that consistently gets upvoted to the top any time someone questions Apple's pricing structure. Please don't change the tune when someone reports a serious ongoing problem.
From MonitorControl's GitHub README, emphasis mine:
> Most modern LCD displays from all major manufacturers supported implemented DDC/CI protocol via USB-C, DisplayPort, HDMI, DVI or VGA to allow for hardware backlight and volume control.
And a blog entry by the author of Lunar, an app mentioned elsewhere for this problem: https://alinpanaitiu.com/blog/journey-to-ddc-on-m1-macs/
These are not examples of "just works". Apple intentionally does these things to cripple integration into non-Apple products.
I ended up going with the nuclear option of an IP KVM https://www.raritan.com/support/product/dominion-kx-iv-101 that will do all the resolutions I want at 60hz. It was very expensive, but on the bright side it lets me keep work laptops completely unmodified and easily swappable.
One question I couldn't see an answer to is whether or not the I can make the network port "sticky" to my Dell notebook (plugged in over USB-C), or will it "move" to my Desktop PC when I switch to it?
I read last year how recent standard made higher wattage delivery over USB-C now standard (I think it was the latest Thunderbolt one), so I'm waiting until these monitors can do that.
2 2.5k/1440p monitors both 144hz and it switches every time. Highly recommend. Albeit a bit pricey.
I did have a considerably more expensive TESmart [1] but couldn't use it because it had some weird incompatibility between it, thunderbolt docking station [2] I used with it (which also work flawlessly), and the MBPs connected to it. I could never figure out why, even raising the issue to support with no luck.
My two cents.
[0] https://www.amazon.com/gp/product/B088WGKFZH
[1] https://www.amazon.com/gp/product/B08N494N7X
[2] https://www.amazon.com/gp/product/B08HR3T837
In this case what's crappy is those desktops rearranging windows when you turn off a monitor. I'd rather have my PC not know whether a monitor is connected or not, like used to be with vga.
A lot of software didn't really care and just sent signals into the void, but it's possible to do that with DVI or DP, too.
I got this https://www.aliexpress.com/item/1005002941646654.html a year ago. It has some minor compatibility problems with my Macbook Pro (or Apples' multiport adapter) which require me to remove and reinsert the USB-C cable from the Macbook once in a while, but it otherwise works very well.
A year later, there are multiple such devices starting from $30, or even less.