Written by Justin Goetz -
Recently, I've found myself in need of a "Keyboard and mouse" sharing application for my linux work stations. I've acquired 2 more work stations, and naturally I couldn’t fit anymore keyboards on my desk... So I needed to find a way to share my keyboard and mouse from one computer to another. A good friend of mine, Adam Longwill, uses a program called a cross-platform program called Synergy to manage his linux computer from his main windows workstation. This program is great, but it is a paid program. I couldn’t quite justify the cost, and I knew the open source community had to have something out there.
I searched for quite a while before stumbling on the "Jewel" of linux mouse & keyboard sharing software. (At least in my opinion.) This program is called X2X. I honestly love this program. It allows seamless mouse and keyboard sharing from one linux desktop to another, all over an encrypted SSH connection.
The downfall? The project has been updated in forever, and some of the files in the github repository date back to almost a decade ago. I'm saddened by the fact that this program has no real home page, and isn't as popular as it should be. With a little TLC, this program could be so much more. I wish I had the coding skills required to contribute to the project, but its beyond my league. Anyway, heres a small guide for myself (And possibly the few readers who see my blog) on how to get this working.
Automating X2X | X2X Can be setup in a way that connecting is seamless. Personally, I have a setup where on my main control PC, I have a desktop shortcut that executes the SSH command. Please note, this method may not be the best way of setting up X2X, but with the lack of support I could find no other way. To begin, I installed x2x on both computers. This is as simple as running:
sudo apt-get install x2x
Next, I setup SSH keys for my SSH session, so I would not be prompted for a password when launching my X2X connection from a desktop shortcut. If you don't know how to setup SSH keys, theres plenty of tutorials online, such as this excellent one from Digital Ocean.
Last, I setup a desktop shortcut to run the following SSH command. Note: This step is not required, and running this command straight out of terminal will work as well.
ssh -XC firstname.lastname@example.org x2x -east -to 0:0
The above command can be customized. Where -east is, you can set this to where your other workstation will be (North, east, south, west). Leaving the other arguments of the command as default should work fine.
This was just a brief overview of the X2X command, a severely underrated program in the linux world, at least in my opinion. Let me know if you run into issues in the comments.