Sharing resources with Synergy

For those who already have worked with more than 1 monitor at the computer, knows that this increases a lot the workflow productivity and daily activities. The good news is that such functionality is available when using different computers, with no additional hardware like as KVM or video cards when using the software Synergy.

Synergy is a free an open source application which allows in an easily way to share the keyboard and mouse between different computers. Didn’t get it? OK, so imagine that you have a laptop and a desktop and you want to work with the both computers at the same time. The point is that is quite boring to keep changing the mouse and keyboard across the computers, no? With Synergy, we can just move the mouse to the right/left/top/bottom changing the screen and the computer respectively.

Synergy is currently suportted at Windows, Linux e MacOS.

Synergy

The Synergy’s configuration is quite simples. To Fedora’s users, it’s just follow the steps below:

# yum install synergy-plus

Once the software is installed we need to configure it. In our environment, we have 2 computers (1 desktop e 1 laptop) running Fedora 15. Synergy basically offers 2 binaries: synergys e synergyc.

synergys: sysnergys (server) should be executed at server, in other words, at the computer which the keyboard/mouse is connected.

synergyc: synergyc (client) should be running at further computers.

To get a big picture from the environment below, here follow some informations:

Hostname: stheo.mmello.org IP: 172.16.69.2 – Server

Hostname: notebook.mmello.org IP: 172.16.69.3 – Client

The first step in our walk-thru, an important requisite is the both computers to be able to resolve the names between each other. If you do not have a DNS server configured, putting the hostnames within /etc/hosts file will be enough.

# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

172.16.69.2 stheo.mmello.local stheo
172.16.69.3 notebook.mmello.local notebook

Filled the /etc/hosts file, let’s heading to Synergy’s configuration.

Server:

stheo $> cat ˜/.synergy.conf
section: screens
   stheo.mmello.local:
   notebook.mmello.local:
end

section: links
   stheo.mmello.local:
      left = notebook.mmello.local
   notebook.mmello.local:
      right = stheo.mmello.local
end

Client:

notebook $> cat ~/.synergy.conf
section: screens
   notebook.mmello.local:
   stheo.mmello.local:
end

section: links
   notebook.mmello.local:
      right = stheo.mmello.local
   stheo.mmello.local:
      left = notebook.mmello.local
end

As we can see above, the Synergy configuration is quite simple. Basically, the configuration points that if we move the mouse to the left, the mouse/keyboard will be redirected to the other computer (notebook). Once at the client, moving the mouse back to the right, the mouse/keyboard will be redirected back to the server (stheo).

Configuration is done, so we need to start the processes synergys and synergyc. A good trick is to create an alias at client/server to start those processes. But you can implement the best configuration which works better for you such as SYSV service, etc.

Alias at server’s side (stheo):

stheo $> alias  | grep start
alias start_monitor_share='synergys -a 172.16.69.2 --name stheo.mmello.local \
 -c /home/mdemello/.synergy.conf'

Alias at client’s side (notebook):

notebook $> alias  | grep start
alias start_monitor_share='synergyc --daemon \
--restart -n notebook.mmello.local stheo.mmello.local'

Note: If the firewall is enabled, allow the network port 24800(tcp).

Afterwards, we can observe at /var/log/messages at the client’s side, some Synergy’s message:

notebook $> sudo cat /var/log/messages | grep Syner
Sep  4 20:26:01 notebook Synergy+ 1.3.4: 2011-09-04T20:26:01 NOTE: started client#012#011synergyc.cpp,331
Sep  4 20:26:01 notebook Synergy+ 1.3.4: 2011-09-04T20:26:01 NOTE: connecting to 'stheo.mmello.local': 172.16.69.2:24800#012#011CClient.cpp,112
Sep  4 20:26:01 notebook Synergy+ 1.3.4: 2011-09-04T20:26:01 NOTE: connected to server#012#011synergyc.cpp,248

Note: the mouse/keyboard redirection will not work when the application windows is maximized. For those cases, Synergy accepts some hot-key configuration.

Surely Synergy is a very interesting and cheap resource when working with multiple computers.

Below follow a video showing Synergy in action and running in other platforms as well.


Cheers and see you!!