Synergy on Fedora 10

May 18th, 2009

Synergy

Ahhh… laziness. It was becoming too hard to rotate my chair the 10 degrees to turn and use my laptop keyboard and mouse. In the past I have used Synergy to share a single keyboard/mouse across multiple computers. Rather than requiring a hardware switch like a KVM, it lets you treat multiple computers as if they were the same desktop. In other words, I can literally use a single mouse to slide the cursor across multiple machines, treating them almost as if it was just a multiple screen display. You can even copy and paste across multiple computers.

So in the above picture, the keyboard and mouse on the tray is being used to control both the desktop and the laptop at the same time. When I slide the cursor off the left of the center monitor, it starts moving the cursor on my laptop. Win.

Here’s a quick overview of the steps to connect my desktop (guardian) as the host (in other words, the keyboard and mouse are connected to it directly) with my laptop (jdob-lt).

1.) Install synergy on both machines. Back when I first used this a few years (and jobs) ago, it was a bit of a pain in the ass to install. Life is a lot easier now since it’s included in the Fedora repositories.

yum -y install synergy

2.) Write the configuration file on the host machine. I’m normally a big fan of text-based configurations, but in this case I think a graphical configuration would make life a lot simpler. The configuration file can be put anywhere, so for consistency I put mine in /etc (make sure it’s readable by whatever user will be running the server daemon).

The following is my configuration file with comments where applicable. Keep in mind my comments are mostly my interpretation of what I’ve pieced together, so if there’s any source of confusion, RTFM.

# Declares the machines that will be connected.
# I used the hostnames of the machines, but there
# may be another means for identification.
section: screens
guardian:
jdob-lt:
end
 
# Describes the orientation of the screens in
# relation to each other. Read as "guardian has
# jdob-lt to the left" and "jdob-lt has guardian to its
# right". Yes, both directions need to be specified.
section: links
guardian:
left = jdob-lt
jdob-lt:
right = guardian
end
 
# I haven't played with this much, but this prevents
# the screen savers from syncing up.
section: options
screenSaverSync = false
end

3.) Start the server daemon. There are two binaries that come with the synergy package, one for the server (synergys) and one for the client (synergyc). Starting the server daemon is as simple as running the server binary and specifying the configuration file.

synergys --config /etc/synergy.conf

Additionally, the -f flag can be passed to the executable to cause it to run in the foreground. This is useful in debugging while you’re getting things set up. For instance, you’ll see messages such as:

DEBUG: CClientProxy1_0.cpp,404: received client "jdob-lt" info shape=0,0 1680x1050
NOTE: CServer.cpp,278: client "jdob-lt" has connected
INFO: CServer.cpp,447: switch from "guardian" to "jdob-lt" at 1679,521
INFO: CScreen.cpp,116: leaving screen
...
INFO: CServer.cpp,1440: screen "guardian" updated clipboard 1
DEBUG: CClientProxy1_0.cpp,278: send clipboard 1 to "jdob-lt" size=119
INFO: CServer.cpp,447: switch from "jdob-lt" to "guardian" at 42,761
INFO: CScreen.cpp,98: entering screen

One last server note, you’ll have to open up port 24800 if you use the synergy default.

4.) Start the client. Similar to the server executable, -f can be passed to keep the process in the foreground and view logging information. When starting the client, simply specify the location of the host (in this case, I have /etc/hosts configured to resolve “guardian” to its static IP).

synergyc guardian

If it connected correctly, you should see logging on the server similar to what’s posted above. A little more apparent is to simply try to slide the cursor from one screen across to a screen on the other computer. If it works, then you’re running.

5.) Sit back and admire the leetness.

The one thing I haven’t bothered with yet is setting this up to automatically run. It’s probably not much to set up some simple init.d scripts (I believe the client will auto-retry by itself in the cases it starts up before the server), I just haven’t taken the time to try yet.

Oh, and for the unenlightened, it runs on Windows too. And yes, you can connect Windows to Linux through synergy. Awesome.

Comments are closed.