Using Synergy software KVM with OSX and Linux
I finally convinced my wife to move to OSX. Because of this change I was able to take her old computer and put it to good use. I installed ubuntu 9.04 on it and set it up as a fileserver and a video server for my playstation 3. I am also using it for some other things. I quickly found it annoying that anytime I wanted to use it I needed to either SSH in (And forward X-windows if I wanted to run graphical apps), or pull out the bulky keyboard and mouse I have and place them on my already crowded desk. To help out with this visualization here is a quick picture of what my desk looks like:

My desk in my home office.
As you can there is little room for another keyboard. This is where Synergy comes in.
What is Synergy?
Synergy is a open source software KVM solution. This means it allows one computer’s keyboard and mouse to seamlessly move to another machine using software. It supports Linux/Unix, Apple’s OSX, Microsoft Windows 95, 98, NT, ME, 2000, and XP. They do not list Vista or Win7 as a supported system and I do not have a license to test with. The software functions by setting up one computer to act as a server (The computer with the keyboard and mouse) and then setting up your other computers as clients. With the rest of this article I will cover the setup and use of Synergy.
How to install
Installing Synergy is very easy. I needed to setup a macbook pro running OSX 10.5.6 and a desktop machine running Ubuntu 9.04. I will cover those in detail and briefly mention the steps needed for Windows as I do not have a Windows computer to test on.
Installing on Ubuntu Linux:
Lucky for us, Synergy is in the Ubuntu repositories. This means all we have to do is install them. You can use many methods. I chose to install “quicksynergy “. This not only installs synergy, but also installs a GUI tool you can use. I however in the end did not use the GUI tool. The following command will install quicksynergy:
If you would like to install just synergy you can use this command:
That is all there is to it. Synergy is now installed on Ubuntu linux.
Installing on OSX
The first step for installing on OSX is to download the binary package from here. The files come in the form of a compressed file that you will need to extract. Once you have done that you will find a folder with both the client and server applications as well as full documentation.
Installing on Windows
Windows is very simple. Just download the installer from the link I gave above for OSX. Run the installer and the program is installed.
Configuring Synergy
Now that you have synergy installed on your machines, you must configure it. First you will need to decide which machine is your server. This is the computer that requires configuration and the computer who’s keyboard and mouse you will be using to control the other computers. In windows there is a gui that will allow you to configure this. Also on Linux you can use quicksynergy to do the same thing. For the purpose of this article however we are going to assume that you have selected OSX as your server as I have. I will note this process is near identical for linux and that windows has a graphical client for setting this up.
I sent a good deal of time hunting for graphical tools to run and configure synergy for OSX. I have 3 tools, however each had major drawbacks that prevented me from pursuing them as an option. I will list them however in case you want to investigate.
- SynergyKM – This was the most promising application I found. It installs Synergy as a preference pane in your control panel. However it has not been updated in a very long time and does not officially use the latest release of Synergy (1.3.1 at this time).
- OSX Synergy GUI – This application ran very slow on my intel mac (It appears to only have a PPC release) and does not support using OSX as a server. So it was out.
- Quick Synergy – Yes this is the same program that you can use on linux. However for some reason this application crashes if you are running OSX 10.5.6. Reading their forums this looks like a known bug.
This leaves us with only one option. Configure the text file by hand and come up with a way to start the service. The text file is easy to configure. I placed the Synergy folder I received from the install in my /Applications folder. I then opened up the synergy.conf file and edited it to meet my needs. My file looks as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | section: screens mac: lin: end section: links mac: right = lin lin: left = mac end section: aliases mac: 192.168.2.10 lin: 192.168.2.20 end |
I will break down the 3 areas of interest.
- section: screens – This area allows you to define what screens you will be controlling with Synergy. Basically you can think of a screen as a computer. Synergy does not care if that computer has multiple monitors. It treats all monitors on that computer as a single screen. In my case I have two computers. I named them mac and lin. You can use their hostnames here and avoid setting up aliases.
- section: links – This area allows you to tell Synergy where each screen is located. You do this by entering a direction and then where the machine is. So this code:
mac: right = lin
Tells you that my linux machine is to the right of my mac.
- section: aliases – This section allows you to setup alternate names for your screens. Here I am using the IP address so that Synergy knows where to look for these screens. I could also use hostnames.
Now that the server is configured we are ready to start up and run Synergy.
Running Synergy
Starting the clients
Starting the clients is the easy part. You have two choices. You can run the GUI or use the command line. When using the GUI you select the client tab and give the client the IP address of the server. Then simply select execute. Here is a screenshot of the GUI:

A screenshot of quicksynergy client setup on Ubuntu 9.04
The problem with this setup is that the client must be started each time you log in to your account. This can be frustrating if do not plan to keep a keyboard and mouse nearby. The ubuntu community documentation has instructions on setting up the client to automatically start. They can be found here. In a nutshell you make a script (Please note the IP address is the address of my server):
1 2 3 4 | #/bin/bash /usr/bin/killall synergyc sleep 1 /usr/bin/synergyc --daemon --restart --name lin 192.168.2.10 |
Notice the “–name lin” is the name of the screen I setup my my server in synergy.conf. Name this script 12synergy and make it executable. Place this script in the /etc/X11/Xsession.d folder. This causes Synergy to start as root when the computer boots. However you also need to edit some scripts so Synergy is killed and restarted as the user when they log in. This means editing the /etc/gdm/Init/Default file as root and placing the following after the last “fi” before the “exit 0″:
1 2 3 4 5 | # ADDED FOR SYNERGY /usr/bin/killall synergyc sleep 1 //usr/bin/synergyc --daemon --restart --name lin 192.168.2.10 # END SYNERGY |
This kills the Synergy client when a user logs in. and allow it to start up running as the user. You can do something similar on OSX. Here is a link that is helpful.
Starting the Server
Now that you have your clients squared away, all that is left is to start the server. Again you could use GUI apps for this but I still think a better way is to use scripts. You have three choices. You can launch on user login (which allows you to use the clipboard between machines), launch on boot (which does not allow you to use the clipboard), or the option I selected, control the processes manually.
For starting on boot you can see this link. If you would like on login the easiest way is to make a applescript and place it in your login items. The script would be as follows (You can edit the kill command and path as you see fit:
1 2 3 4 5 6 7 | set synergyPath to "/Applications/synergy-1.3.1/synergys -f --name mac --config /Applications/synergy-1.3.1/synergy.conf &> /dev/null &" set killCommand to "killall synergys" do shell script killCommand delay 1 do shell script synergyPath end |
Notice that the “–name mac” is the name of the screen I setup in synergy.conf.
I however wanted more control. I wanted to be able to turn on the service when I needed it and turn it off when I didn’t want it, such as when I’m gaming. So I wrote another applescript. This one I saved as an application bundle and placed in my Dock. Now when I click it it gives me a graphical option to start or stop the service. The script is smart enough to check if the service is running and will not start duplicates. Here is the code for that script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | set synergyPath to "/Applications/synergy-1.3.1/synergys -f --name mac --config /Applications/synergy-1.3.1/synergy.conf &> /dev/null &" set killCommand to "killall synergys" set question to display dialog "Do you wish to start or stop the synergy daemon?" buttons {"Start", "Stop"} default button 1 set answer to button returned of question if answer is equal to "Start" then tell application "System Events" if exists process "synergys" then display alert "Synergy is already running. Please stop it first." else do shell script synergyPath display alert "Synergy has been started" end if end tell end if if answer is equal to "Stop" then tell application "System Events" if exists process "synergys" then do shell script killCommand display alert "Synergy has been stopped." else display alert "Synergy is not running and therfor can not be stopped." end if end tell end if |
The resulting output looks like this:

Example of the synergy applescript output.
I plan to eventually write a native application that will handle this a little more robustly. However this solution works great and solves my problems.
So give it a try!

It was pointed out to me that I missed a great application for setting up and controlling Synergy. QSynergy is a cross-platform graphical tool for configuring and running Synergy. You can find it here
Great stuff. The section on starting the synergyc client on linux was just what I was after. Can now start up my computers and only need one keyboard to login.
Cheers,
GCG.
Great article
[...] http://tacticalcoder.com/blog/2009/05/using-synergy-software-kvm-with-osx-and-linux/ [...]
[...] http://tacticalcoder.com/blog/2009/05/using-synergy-software-kvm-with-osx-and-linux/ [...]