Managing Multiple PCs With Synergy

April 18th, 2010 by templewulf

Synergy is a software package that allows you to link PCs together in a way that resembles traditional multi monitor usage. By mousing past the edge of one monitor, you move your cursor into a different PC entirely. This has been tremendously useful in my multi-platform development, so I’d like to share what I’ve learned about it. Using my Windows Vista and Ubuntu 10.04 PCs, I will demonstrate how to install and configure Synergy for home use.

    Preparations

  1. First, make sure that each computer has a monitor physically connected to it. Then, decide which one will act as the Synergy “server”. This is just the computer to which the keyboard and mouse will be connected. For this, I used my Windows PC, because Linux can be run through SSH in a pinch.
  2. Next, you need to document the names of your computers to use in configuration files later. For instance, my Windows PC is templewulf-PC, and my Ubuntu PC is templewulf-LAMP.
  3. Lastly, make sure your computers can find each other over the network by their names. If not, try adding them to each others’ hosts files. Alternatively, you can use IP addresses in config files if you’re willing to set up static IPs on each machine.
  4. Windows Installation

  5. Synergy Configuration Form

    With preparations complete, you can proceed by installing Synergy to the PC that will act as the server. Versions for all platforms are available at sourceforge. Next, you’ll need to configure the server. Open Synergy and click the “Screens & Links” Configure button. Your “screens” are the PCs you want to connect, so enter the names of your computers here. You shouldn’t need to change the screen options.

  6. In order to transfer your mouse from one “screen” to another, you’ll need to define their relationships under the “Links” section. For instance, I have “templewulf-PC is left of templewulf-LAMP” and “templewulf-LAMP is right of templewulf-PC“. Remember to define a Link for each way, so your mouse can get back!
  7. Linux Installation

  8. Install the Synergy application to all the PCs acting as clients. On Ubuntu, it’s just one “sudo apt-get install synergy” between you and screen sharing. There isn’t a convenient configuration GUI for Linux, so you’ll need to create a conf file for it. You’ll want it at /etc/synergy.conf, and it should look something like this:
    # This section defines the hosts.
    section: screens
    	templewulf-PC:
    	templewulf-LAMP:
    		super = meta
    end
    
    # This section defines the relationships between the hosts.
    section: links
    	templewulf-PC:
    		right = templewulf-LAMP
    	templewulf-LAMP
    		left  = templewulf-PC
    end
  9. List of running hosts on the Synergy server

    With the client configuration done, we can start the client on the Linux machine. To test Synergy, open a terminal window and issue the command synergyc -f templewulf-PC. The -f parameter forces output to the foreground so that you can see debug messages in your terminal. When the client connects, the Synergy icon in your server’s system tray will change to a lightning bolt. You can confirm the connection by clicking on the icon and checking the client list as shown in the diagram. At this point, you can stop the foreground client using Ctrl+C in the terminal. If you want to restart it right away, issue the same command without the -f flag

  10. The Synergy project has a page on autostart configuration. For Ubuntu 10.04, the gdm folders are a little different. On my system, I only added the following to /etc/gdm/Init/Default:
    /usr/bin/killall synergyc
    sleep1
    /usr/bin/synergyc --daemon templewulf-PC

    I added mine at the end, just before the exit 0 line. Normally, an application would be added to the System > Preferences > Startup Applications menu, but those don’t start until a session begins at sign-in. We want synergy to launch even before the user login screen, so gdm Init is the perfect place for it.

  11. Optionally, you may install the synergy server on your main machine. Since the keyboard and mouse are already installed on this one, you may opt to start synergy manually after restarting Windows. Otherwise, launch Synergy on your server (e.g. templewulf-PC) and click on AutoStart. Simply click on your chosen Install button, and it takes care of the rest.

Conclusion

With that, you are ready to use linked systems through Synergy. Some features to try include adding additional links to create wrap-around connectivity, preventing screen transfer in certain corners (to ease the use of window buttons at the edges of screens), and copious use of the shared clipboard. Happy computing!

Comments are closed.