Easy Pairing With Synergy 4
Pair programming is a very powerful development practice. It’s a great way to learn, to solve hard problems, and to write really excellent code. However, there are a number of human issues that can make pairing more difficult than it needs to be. Synergy is a tool that has helped me solve many of those problems. Here’s how…
Synergy is basically a software KVM (without the V). It lets you share one keyboard and mouse among many different computers. While originally designed as a tool for sysadmins, I’ve been using it to make pairing easier, especially in environments that aren’t really conducive to pushing a keyboard back and forth.
Synergy can be run in server or client mode. The machine running the server shares it’s keyboard and mouse with the client(s). I usually run as the server, because I’m pairing with a developer who’s working on some code that he has checked out on his machine. I start the server like this:
synergys --name BensMac
I’m not specifying a config file here, because I have a .synergy.conf file in my home directory that looks like this:
section: screens
BensMac:
WindowsBoxToTheLeft:
super = alt
alt = ctrl
WindowsBoxToTheRight:
super = alt
alt = ctrl
end
section: links
BensMac:
left = WindowsBoxToTheLeft
right = WindowsBoxToTheRight
WindowsBoxToTheLeft:
right = BensMac
WindowsBoxToTheRight:
left = BensMac
end
Synergy treats each machine as a “screen” and the screens are configured here. I’ve got one screen called “BensMac”, which is me. When I launched the server, notice that I specified what screen I was using the --name option.
I’m pairing with a developer who’s running windows and sitting to the left of me, so he runs the synergy client and connects to my machine like so:
synergyc --name WindowsBoxToTheLeft my.ip.addr.ess
What this does is tell synergy to connect to my machine using the screen name WindowsBoxToTheLeft. As you can see in my config file, that screen is set up with some specific settings. BensMac is specified to be to the right of WindowsBoxToTheLeft and vice-versa. I’ve also remapped a few keys for that screen, so that the command key maps to control and the option key maps to alt (normally, synergy reverses them). I haven’t had the opportunity to set up a LinuxBoxToTheLeft, but the setup would be similar.
Now that we’re connected, I can move my mouse over to the left side of my screen and it “appears” on the other developer’s screen. I can control it, click on things, type whatever I want. I can even copy text on my machine and paste it onto his. I find this much more effective than the standard pairing setup of two developers and one keyboard, because it allows for more fluid collaboration, and makes it much easier to change “drivers”.
For those afraid of the command line, there’s also a windows GUI client that operates in the same way. You specify a screen name, and an ip address, and away you go. It’s any easy download and a great way to start off a pairing session.
If you find yourself pairing a lot, with a lot of different people, try using Synergy. Once you’ve got it configured, it’s quick to set up, and it’s a great tool to facilitate face-to-face collaboration.

Nice. I’ll have to give it a try.
I’ve done remote pairing using Window’s Remove Desktop sharing. It’s not ideal, but it can work well enough if you’ve got a good end-to-end connection.
For Mac users, there is a collaborative editor called SubEthaEdit.
For a Windows-specific solution, Microsoft recently released SharedView Beta, a screen-sharing application that is nice for remote pair-programming.
(disclaimer: I do work on the SharedView team at Microsoft).
Hi Ben, one thing I don’t fully understand is this: are you using Synergy as a tool for remote pairing or your pair is sitting near to you?
My pairing partner is sitting next to me.