my package of the day: synergy and quicksynergy – share a single mouse, keyboard and clipboard between multiple computers

Once upon a time… I sat beneath a person who tried to show me something on his GNU/Linux desktop. As he noticed, he needs to copy a password from his Windows machine (was it OS X?), which was standing close, I waited for him to copy and paste by using his eyes. But hey: He just moved his mouse across the boarder of his screen and the mouse pointer appeared on the screen of the other computer. There he marked something, copied it to the clipboard by using the very keyboard, moved his mouse back to the first screen and pasted the content from the clipboard. I am neither talking about two screens attached to one computer, nor about a kvm device. You can probably imagine, how surprised I was…

The solution to this magic is rather simple. It is called „Synergy“ – a program available for GNU/Linux, Windows, OS X. It is a server/client application. Given the situation that you are mainly using one computer – let’s say your desktop, but also need access to your notebook, or even notebooks, standing left and/or right of your desktop screen, you make your desktop the synergy server. This is rather simple: Install the packages „synergy“ and for your convenience „quicksynergy“ – a graphical configuration wrapper – by calling „aptitude install synergy quicksynergy“ or just Synaptic on EVERY machine.

Now let’s get it running: First, start „Quicksynergy“ on your main computer (the desktop in this case) from your menu (you should find it under Accessories or Utilities). Click on „Settings“ to make sure, that the checkbox „Keep… running“ is not checked, as you probably don’t want to see Quicksynergy the whole time. Now go back to „Share“. You see you computer in the middle and four text boxes around it. The magic of Synergy is, that you need to know the hostname of the computer that wants to connect to your computer as Synergy relies on this information. If you are unsure, just run a „hostname“ on the console of the other machine.  I repeat: Don’t use fancy names, don’t use the ip address here – you need the hostname of the machine that will connect to your computer.

In my case my notebook is called „hasung“. Now decide, where the connecting computer/notebook is placed. In my case „hasung“ is right of my desktop screen. Therefore I enter the term „hasung“ into the text field labeled „Right“:

bildschirmfoto-quicksynergy.png

Afterwards clicking „Start“ will launch the Synergy daemon and fork the program into the background.

Now you have to find out the ip address of your main computer, as the computer/notebook beneath needs to connect to it. If you don’t know how to do this: open a console and run „ifconfig | grep inet“. If you are on a typical local area network, it will start with something like „192.“ or „10.“. Just check it out or ask somebody who knows. In my case the ip address is „192.168.1.2“.

Now lay your fingers on the keyboard of your second machine – hopefully for the last time for today. You have two ways of connecting here – either by using quicksynergy or by using the command line. If you want a gui, start Quicksynergy, make sure, that the checkbox „Keep… running“ is not checked, on the „Settings“ tab, then click on the tab „Use“ and enter the ip address of your main machine, where the synergy daemon is already running. In my case „192.168.1.2“:

bildschirmfoto-quicksynergy-1.png

Click start and you should be up and running! Check this by using the mouse of your main computer and move the mouse pointer beyond the (right or left) screen frontier. The mouse pointer should appear on the other screen. You are done!

Network issues in Ubuntu Hardy

With Ubuntu Hardy suddenly strange things happened with synergy, as something on the network layer of the kernel has changed. The best workaround I know so far, is to run (quick)synergy on the client with sudo, so it does not get interrupted that often. As I am a heavy console user, I just run

$ sudo synergyc 192.168.1.2

from a terminal window instead of quicksynergy. If you have a better hint, let me know.

Firewall

Synergy opens a tcp port on the main machine. If you are using a firewall or even iptables manually you have to allow acccess to this port. Synergy uses port „24800“ by default. So if you know what you are doing, a „iptables -A INPUT -p tcp –dport 24800 -j ACCEPT“ might help you.

Staying on the same network

Actually your computers don’t have to be in the same network, but: The client machine has to be able to access the synergy tcp port on the master. Imagine the following: You are bringing your notebook to your company. It uses wifi while your desktop uses a cable connection. As your administrator does not trust wifi connections, he split the networks, so no direct connection from the wifi network to the cable network is possible. In this case you have to deal with your administrator. But trust me: synergy is not a reason for breaking company security rules :)

Security

From a security point of view, synergy is … let’s say… simple. There is no password protection, no security layer, no encryption. The only access control is the hostname of the client, which can, of course simply be forked. What does that mean? It means two things: First: People could annoy you by using your hostname on their machine and connect to your synergy instance. Counter measure? Ban them by using a local firewall, if you know, how. Second: People on the network might be able to sniff your data (mouse gestures, key strokes, content of the clipboard). Counter measures? Use a ssh tunnel! I won’t explain this here, but might already have a clue, what I am talking about.

Recovery

If your (quick)synergy forked into the background and you feel, that somehow it all does not work, open a terminal and run „pkill synergy“or „sudo pkill synergy“. This should stop all running instances.

Get more!

As might already have noticed, you can even connect more machines. Feel free to place machines to the left and right, even upper and lower side of your main screen at the same time.

So that’s for now. Feel free to post your experiences here, and yes: I am also using synergy in combination with hosts running Windows and/or OS X, though configuration on GNU/Linux with Quicksynergy is the best method I have seen.

7 Gedanken zu “my package of the day: synergy and quicksynergy – share a single mouse, keyboard and clipboard between multiple computers

  1. Woah! This is so timely man! I just bought a new LCD screen for my office desktop and I have a laptop too. This works great for my setup. Thanks a lot. Keep up the good work.

  2. I had no idea there was ‚quicksynergy‘. Thanks for the heads up.

  3. The reason that SSH is a good idea is because all of your keystrokes entered on a client (think unlocking administration functions) are passed in the clear and can be sniffed.

    Quicksynergy is buggy for me. It works for clients but for some reason I cannot use it to start a synergy server. Building SSH tunnels and starting up synergy is a pain too.

  4. Pingback: Synergy «

  5. yo guys who was write this tutorial
    i was a trouble with synergy.
    and i fix this problem by the opening the port in firewall
    NB! if you have trouble with client connection –> connection time out.
    possibly u do not open needed ports
    in this tutorial dont show how to open ports
    now i was reinstall my os (server) and i again have same problem i cant open ports in firewall
    it is for admin if you are give a tutorial please give complete
    i cant start synergy again
    i was try my rules in firewall dont work
    sorry for my english
    with respect

  6. lol i was read again and see my mistake sorry,
    and my synergy start working

    thanx dude u show me mistake if make all fast it looks lol

  7. Pingback: epe.at

Schreib einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *