HowTo: Use Synergy to Control Several Workstations from One Keyboard and Mouse
Novell Cool Solutions: Feature
Digg This -
Posted: 29 Sep 2005
|Learning to use Linux at Home and Work
Welcome to my ongoing series of HowTo articles designed to help Linux newbies get comfortable with Linux. Before trying any of these HowTos, take a few minutes to study the prerequisites so you can hit the ground running.
Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s). You will find synergy in SUSE 9.3, although you can download versions for other OSes, including MS windows from
You need to install the synergy server on the controlling computer, i.e. the one attached to the keyboard and mouse you will be using, and the client on all the other Ethernet networked computers. Actually the number of computers will be governed by the number of screens you can fit on your desk, plus the limits of how you can describe their positional relationships in the synergy configuration file "/etc/synergy.conf".
I shall describe my simple setup which is my SUSE 9.3 box connected to an old P2 laptop running Knoppix on its hard drive. Knoppix didn't come with synergy, so I hacked the connection by using NFS to copy the "synergyc" file from SUSE 9.3 into "/usr/local/bin" on the Knoppix laptop. When I tried to run this file it complained of not being able to find "libXinerama.so.1". On the SUSE 9.3 box this is a link in "/usr/X11R6/lib" to "libXinerama.so.1.0" in the same folder. I used NFS to copy these two files into "/usr/X11R6/lib" on the laptop, and ran the "ldconfig" shell command to make sure the library linker knew where to find them. Running the "synergyc" command again brought up no errors, (apart from the fact it couldn't connect to the server, which I hadn't started yet) so I knew I was in a lot of luck, and wouldn't have to find compiled versions for Knoppix.
Before you can run synergy you have to edit the /etc/synergy.conf file.
This is how it looks before you edit.
# sample synergy configuration file # # comments begin with the # character and continue to the end of # line. comments may appear anywhere the syntax permits. section: screens # three hosts named: moe, larry, and curly moe: larry: curly: end section: links # larry is to the right of moe and curly is above moe moe: right = larry up = curly # moe is to the left of larry and curly is above larry. # note that curly is above both moe and larry and moe # and larry have a symmetric connection (they're in # opposite directions of each other). larry: left = moe up = curly # larry is below curly. if you move up from moe and then # down, you'll end up on larry. curly: down = larry end section: aliases # curly is also known as shemp curly: shemp end
Here is a picture I drew to help you see this relationship. You don't have to physically have the monitors in these positions, as long as you remember where to move your mouse.
In my set up I have only two screen, one called "linux" and the other "Knoppix", which are positioned like "larry" and "moe" respectively, so this is my synergy.conf.
# stomfi synergy configuration file # section: screens # two hosts named: Knoppix, linux linux: Knoppix: end section: links # linux is to the right of Knoppix linux: left = Knoppix # Knoppix is to the left of linux # Knoppix and linux have a symmetric connection (they're in # opposite directions of each other). Knoppix: right = linux end
Note that this is a read only file so as root you will have to give the vi command ":w!" to save your changes.
Both host computers in the network need to be able to find each other's IP numbers. This is done in the "/etc/hosts" file in both computers. These are my two lines to achieve this.
10.0.0.2 linux linux 10.0.0.3 Knoppix Knoppix
Starting the synergy server is done in the GUI by this shell command on "linux" in my case.
synergys -f --config synergy.conf
which will look in /etc for the configuration file. You can use an alternate config file with an explicit path.
Once the server is running, it is time to go to the client and in the GUI in a shell terminal use the command
synergyc -f linux
where you replace linux with the name of your server host.
The shell terminal gave me messages about not being able to connect, so I looked in the html documentation (On SUSE 9.3, this is in "/usr/share/doc/packages/synergy/index.html") which told me that the synergy default port was 24800. Of course I have the SUSE firewall running and this was preventing the connection.
The simple solution is to tell the firewall to allow connections on this port. Open YaST and choose Security and Users ? Firewall. Click next to reconfigure, and next if you have more than one interface. In the Firewall Configuration: Services window click "Expert" and put 24800 in the TCP field like this.
Click OK and next till you get back to finish to save and restart your firewall. CTRL-c both the synergy clients and server. Restart the server and clients and move the mouse to the chosen side of the screen, where it should disappear, and re-appear in the other monitor.
You may find you can't use the physically attached keyboard when synergy is running, but that's not the idea anyway.
Once the mouse is in the other monitor, the keyboard is there as well.
On SUSE you can start the server and client as a start program in the window manager, just making sure that the server is going to be running, as the client will keep looking for a connection.
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com