Thursday, March 14, 2013

CONTROL MULTIPLE PC’S WITH ONE KEYBOARD AND MOUSE


If you are anything like me and you have a number of machines running at one time, switching keyboards and mice can become frustrating and not to mention confusing (at times). With Synergy (synergy-foss.org) you can control multiple computers with a single keyboard and mouse.

For this tutorial, I decided to use Ubuntu as the Server PC and my Windows 7 machine as the client.


 

The Synergy .deb in the Ubuntu repo’s is a slightly older version than is available on their site, but as the site releases are only in Beta, this did not bother me.

Download Synergy for both (or all) machines. For windows download the 1.3.8 release version for your machine (32 or 64 bit) from http://synergy-foss.org/download/?alt

For Ubuntu (Or other Debian based machines) install synergy from the repo’s


sudo apt-get install synergy


Once installed on the Ubuntu machine, we need to create a config file. Create a “synergy.conf” file anywhere you like. I created mine in /etc/


sudo nano /etc/synergy.conf


If you would prefer a non-terminal based text editor use the likes of gedit, or any other editor in place of “nano”

Copy or Paste the following into your new conf file


section: screens
xubuntu:
windowspc:
end


section: aliases
windowspc:
192.168.1.115
end

section: links
xubuntu:
left = windowspc
windowspc:
right = xubuntu
end

section: options
screenSaverSync = false
keystroke(f12) = lockCursorToScreen(toggle)
end



You can change the variable names of xubuntu and windowspc if you wish, just remember what you called them.


section: aliases
windowspc:
192.168.1.115
end


For the aliases section, you need to local IP of the client machine (in this case our windows 7 machine). To get this press Windows Key + R and type “cmd”. In the prompt that opens type “ipconfig” and look for the “IPv4 Address” that resembles 192.168.X.XXX. Place this number in where I have 192.168.1.115

The following line sets the synergy bind key, that keeps your mouse pointer and keyboard fixed to a machine. This  is usually set to the “Scroll lock” button but can be changed.


keystroke(f12) = lockCursorToScreen(toggle)


Once you have that completed. Save your file (Ctrl + X > Enter [if using nano]). Then make sure it has the appropriate permissions


sudo chmod a+r /etc/synergy.conf


Now we test if everything is working. In a terminal enter the following


syngergys -f –name xubuntu –config /etc/synergy.conf


–name xubuntu is the name we gave the ubuntu machine in the config file. If you changed it in the config, use the changed value here

-f indicates debug mode and we will only be using this to test if everything is ok

If synergys starts without any issues and you dont see a FATAL message, press Ctrl + C and remove the -f from the above command before running again. If you do get a FATAL message, please post below and I shall try and assist.

Before we move onto setting up the client run the following from a terminal


ifconfig | grep "inet addr"


make note of the “inet addr: 192.168.X.XXX” number

That is our server finally set up, now we must move onto our client. After installing synergy on windows, start synergy and select “Use another computer’s shard keyboard and mouse (client)”. Paste in the code from the previous step and hit start (closethe warning message). Press the auto start button on your windows side to have it start at login (or on boot if you prefer).

If everything went as planned, you should now have a single keyboard and mouse running between the two machines.

The last thing to do is add synergys to Ubuntu’s startup. To do this go to System > Preferences > Session and Startup > Application Autostart > Add.

Give the startup task a name (Synergy) and a description (Synergy). In the command field add 


/usr/bin/synergys –config /etc/synergy.conf


Thats it. Any questions or queries, feel free to post them below

No comments:

Post a Comment