Rate this page del.icio.us  Digg slashdot StumbleUpon

Sharing a keyboard and mouse with Synergy

by

by Anderson Silva and Steve ‘Ashcrow’ Milner

Synergy is an open source project that allows you to share a keyboard and a mouse among several different computers, each connected to some sort of monitor, without any extra hardware (i.e. KVM switches). Synergy runs over the network and can be used with several different operating systems.

Synergy runs as a client/server application, where the server is the computer that will have the keyboard and mouse attached to it, and all others will connect as clients. Switching from one display to another is only a matter of moving the mouse to the edge of the screen, and Synergy will detect the mouse pointer leaving one screen and entering another.

Advantages of using Synergy

  • You can copy and paste between computers since Synergy merges clipboards across the systems.
  • It synchronizes screen savers (lock screens), so they start up at the same time.
  • If you have an old computer or laptop, you can use it as a Synergy client through an SSH session, and you can make your multi-computer environment behave like a multi-display workstation.

Installing Synergy on Fedora machines

As root:

            yum install synergy

Setting up Synergy as the server

Create a config file called synergy.conf (you may place it in /etc or in ~/.synergy.conf). Below is a basic example of the synergy.conf file that configures a client workstation to the right of the server. Notice that under the options section, we have turned on the screensaver synchronization.

section: options
    screenSaverSync = true
end
section: screens
    server.hostname:
   client.hostname:
end
section: links
    server.hostname:
    right = client.hostname
   client.hostname:
       left = server.hostname
end

The screens sections defines what screens are available. In the links section, the screens are set up relative to each other.

You can find more detailed configuration options at Synergy’s configuration file format page.

Starting up Synergy as the server

As your regular (non-root) user, start the server:

	synergys --config /etc/synergy.conf

Alternatively, you can write or use a script like the one found at http://stevemilner.org/media/blog-images/synergy. The Synergy web site also has a dedicated session for auto-starting the Synergy server on different platforms.

Setting up Synergy as the client

  1. Make sure you have installed the Synergy package on your client machines just like you did on the server.
  2. Make sure your client and server have a defined hostname other than localhost.
  3. Make sure you are logged in to your X environment.
  4. Don’t run synergyc as root
  5. Open a terminal and start up the client:
    	synergyc -f server.hostname

If the connection is successful, you will see the message below as part of the output from the connections:

	NOTE: synergyc.cpp,247: connected to server 

If the connection fails, the client will keep trying to re-connect a few more times, but we recommend you look at Synergy’s troubleshooting page.

Once you have successfully connected the client and the server, you can remove the -f option from the synergyc command, and it will run as a background process on your computer.

Firewall

As with any good server-client application, it is important to remember that you may need to configure your firewall to allow the connections between synergys and synergyc to be established. Synergy runs on port 24800 by default, but by using the -a option, you can customize the server to listen on a different socket.

Privacy

Note that if you will be using Synergy over a network that is shared with other users, you may want to look into wrapping your usage with stunnel or SSH.

Similar projects

Synergy is not the only project for sharing a keyboard and mouse! If Synergy doesn’t meet your needs, check out x2x or the upcoming mango lassi.

Conclusion

With Synergy set up and installed, you no longer have to envy coworkers with multi-monitor setups, and you will be able to breathe new life into your old computers and displays.

Acknowledgments

Anderson and Steve would like to thank Brenton Leanhardt for catching a couple of bugs on this article. Thanks, man!

For more information visit http://synergy2.sourceforge.net/.

3 responses to “Sharing a keyboard and mouse with Synergy”

  1. Hrafn says:

    Thanx

  2. granula45 says:

    !
    !
    , , !
    , 200$-350$ ! ( , ! … , ( … )!

    !!!
    , , , , !
    – ICQ – 353-867-001

    , , ! !

    !!!
    , , !
    !

    , , , ICQ -353-867-001


    !

  3. ritz says:

    To use synergy with wierd res

    http://tsunanet.blogspot.com/2008/03/getting-synergy-to-work-with-non.html

    – ritz