What I learned about KVMs and USB switches
I have two computers on my desk: my Desktop gaming computer, a System76 Theilo Mira, and a MacBook Pro M2 from work. When I work at my desk, both of those computers are connected to the same ultrawide display, my mechanical keyboard, and my Bluetooth mouse. Since I don’t want to disconnect all the cables and the Mouse’s USB dongle from one computer and reconnect them to the other every time I want to switch between computers1, I need a different solution.
Here are the ways I’ve familiarized myself with for the last two weeks or so.
First, you could “remote” from one computer to another. Both the Linux Desktop and the MacBook come with options to connect to another computer remotely, controlling the other computer’s mouse and display from afar2. This solution is usually good enough, especially if you do typical work on both computers, like browsing the net, answering emails, or chatting. However, it becomes a problem once you want to game on one computer, since the connection can be too slow for real-time video feeds. It is also not ideal if you turn off one of the computers, because then you lose the connection and you have to log into the remote computers manually first3. There is also a software-based KVM (we will discuss KMVs next), which is essentially the same thing as far as we’re concerned here. I was playing with such a solution, but it was unreliable.
The two other ways are physical. You could use a KVM switch or a USB switch. A KVM (Keyboard, Video, Mouse) switch does exactly that. The connection of computer 1 and computer 2 goes into a KVM switch, which looks like a black box, and the switch connects to the screen, mouse, and keyboard they share. The physical connection means that you have a quick video connection, so you can stream videos and play games. It also resolves the problem if you need to restart: as long as you have the computer connected, you’ll get the prompt to enter your user name and password to log in when you restart. I’ve used a KVM for years, until my KVM switch died. At first I wanted to get a new one from the same brand be done with it, but KVM switches get a bit more complicated. We’ll get to that in a minute.
A USB switch is a similar concept, except that it applies to USB devices only. Both computers connect to the switch, and you plug your USB keyboard and USB-dongle (for a Bluetooth mouse) into it. When you want to reconnect your mouse and keyboard from computer 1 and reconnect them to computer 2, you press a button, and the switch does it for you. The main issue here is that the screens do not connect to this switch, so you’d have to do that manually.
As it turns out, KVM switches are more complex and come in various types. These days, they’re more geared toward IT folks and can handle four and even eight computers at once. They can offer audio support, so speakers can also switch between computers, and some come with a remote control. All this sophistication means money: A KVM switch usually starts at over $100 and can go over $500. In addition, I found out that the cheaper options do not handle a mechanical gaming keyboard (like mine) well: the dedicated keyboard USB port on the KVM switch doesn’t “understand” gaming keyboards because of their complex nature, and as a result, you’d have to connect those to one of its regular USB ports, which means one less prefierals you can connect, and also no hardware keyboard shortcut to switch between computers. In my particular case, I also found out that my speakers didn’t switch between my computers for some reason.
I contacted their support and got a nice long explanation from them, which basically amounts to try updating the KVM switch’s firmware (by connecting it to a Windows computer, which I don’t have at the moment, and need to try from a virtual environment), and even then they can’t promise the keyboard will be supported.
None of the issues I just described is a deal-breaker for me, besides the price. For a brand new piece of hardware that cost me over $100, I wasn’t willing to settle when I knew a cheaper solution existed. So I got myself a USB switch.
The USB switch has been working well. It seems to be faster than the KVM switch, and when I got it I learned that Anker, which is a brand liked by many including me, also has an HDMI switch - a separate small switch to switch screens, for an additional $20. Both of these switches cost me about half of what the KVM switch cost me. I need to press two buttons now (one on the HDMI switch and one on the USB switch) when I want to switch between computers, but that’s not a problem. In exchange, I don’t have the issue where my Mac would not wake up when switched back too quickly4. I also have more USB ports to use between both computers (my webcam for example).
[img]
So far this setup works OK. There are times when I switch back to the Mac, it doesn’t wake up, but it happens irregularly and I think it’s the fault of something I’m running in the background. I’m still looking into it. It also seems that more demanding games even have less delay with the keyboard now than before, like in Helldivers for example. I’ll give it a few days and then I’ll return my KVM switch.
Footnotes
1: some would ask, why not just keep them separate? On a different desk, maybe with two different screens? Well first, I live in a small apartment (this is NYC, yes?) and I don’t want to shove another desk in my room, though it is possible. Second, I use a fancy mechanical split ergonomic keyboard which I enjoy typing on, and I also like my widescreen setup. I don’t want to buy these things twice. Some people use a dual-screen setup, but I never liked having that split right in the middle.
2: If you ever had an IT person support your computer, you’d know what I mean - your mouse cursor would move on its own and the tech would open and close windows, type some mysterious commands int the terminal, etc.
3: Most modern computers (including Macs) are encrypted and block remote access when restarted. You could leave your computers on to get around that, but restarts are needed at least once in a while.
4: To save space, I have my MacBook’s lid closed when it’s connected to all the cables and a power source. This is called docking or docking mode, and MacBooks are meant to work this way; they remain on when connected to an external keyboard and screen as long as they’re also connected to power. When you switch to the other computer though the Mac assumes it’s just closed (and not docked) and will sleep. Regularly, when you close the lid and open it after a few moments, you’ll be prompted to enter your username/password, but things get a bit tricky if the Mac remains physically closed. The KVM switch / USB switch needs to “convince” the Mac that it’s being opened when it’s actually physically closed, and that can get tricky. I found out that the USB switch doesn’t always do the job (an issue that exists with KVM switches). The workaround is to disconnect the power from the Mac and reconnect it; since it’s a MagSafe connection, it’s just a matter of reattaching a magnet. It’s annoying I have to do this, but it’s better than plugging in a physical cable each time. Yet another workaround is to use the caffeinate command on the Mac, which is not ideal. But this is quickly becoming material for another post.