OpenSUSE Linux Rants

OpenSUSE Linux Tips, tricks, how-tos, opinions, and news

My Resume  -  My LinkedIn Profile

March 27, 2007

Software KVM switch : synergy on Linux

by @ 7:06 am. Filed under How-To, review, SUSE Tips & Tricks


One thing people really love is desktop real estate. Seriously, it’s a fundamental law of life: “Bigger is better.” Unless you’re referring to like a nail in your head or something. But generally, people like bigger, especially when it comes to their monitors. Lately, I’ve been using this sweet app that doesn’t quite give me a bigger monitor, but it does give me something very similar. It’s called “synergy.”

From the project website: “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).” Translation: pretty much a software KVM switch.

The way it works is that you have a synergy server running on one machine, like your main desktop. You also have a synergy client running on another machine, like a laptop that you have next to you on your desk. When you drag your mouse past the edge of the screen on your desktop, the mouse cursor and current clipboard contents magically appear on the client machine, your laptop in this case.

Using synergy is very similar to having two monitors because you just drag the mouse between the two seamlessly. It is different because the monitor on the client machine is obviously not hard-wired directly to the main desktop, it is still driven by the machine it is connected to (the laptop, in this case). You have two completely separate systems controlled from a single mouse and keyboard. You don’t have to switch to that little tiny keyboard on your laptop or use the touchpad or eraser mouse on it, either. You just slap your mouse over to the edge of your desktop monitor, and it appears on your laptop monitor, and away you go.

The clipboard is shared, as well. If you hit a URL on the laptop that you want to open on the desktop, copy it to the clipboard, drag the mouse cursor back over to the desktop, open Firefox, and middle-click. Done.

What will really kick you in the head is that this program is cross-platform. It runs on Windows and Linux (apparently, not so well on Mac).

synergy is a bit of a paradigm shift to get used to, but when you do, you can’t live without it.

K, I can see that I have your attention, and you don’t want to screw around with figuring out how to make it work. You would like some brief quick-start instructions. So what are we waiting for?

To make this baby go, you need two computers. In my case, the server machine (my desktop) is an AMD 64-bit machine running SUSE 10.1. This machine is called tomahawk. The client machine (my laptop) is an Intel Duo machine running openSUSE 10.2. It is called laptop.

On each computer, do the following:

Install synergy

Open YAST => Software => Software Management. Search for ‘synergy‘, check the box next to it when it comes up, and click ACCEPT in the lower-right corner. synergy is installed accordingly.

Configure synergy

On the client machine, called laptop, I have put an appropriate entry in the /etc/hosts file for the desktop, which looks like this:

[0032][scott@laptop:~]$ cat /etc/hosts
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#       localhost   tomahawk


On the desktop, I had to create a small config file called synergy.conf, which looks like this:

[0031][scott@tomahawk:~]$ cat synergy.conf
    section: screens
    section: links
           left = laptop
           right = tomahawk


This file is just in my home directory (/home/scott/synergy.conf, in this case). Where ‘tomahawk‘ appears, that is my desktop. Where ‘laptop‘ appears, that is my… yes… laptop. In this configuration, the monitor on the right is the ‘tomahawk‘ monitor, and the monitor on the left is the ‘laptop‘ monitor. When the mouse is on ‘laptop‘, and it hits the right side, it will disappear and reappear on ‘tomahawk‘. Likewise, when the mouse is on the ‘tomahawk‘ monitor, and we run it off the left side of the screen, it will disappear and reappear on the ‘laptop‘ monitor.

Adjust the contents of this config file according to your setup.

Run synergy

Maybe someone else is more gifted than I am, but I was only able to get synergy working in foreground mode, and it would absolutely not run as a daemon. I did find a way around this, but if anyone else knows how to make it work right, please post a comment here so everyone else can have it, too.

commandline for tomahawk:

[0031][scott@tomahawk:~]$ synergys -f --config synergy.conf > /dev/null 2>&1 & 


Basically, run the synergy server in the foreground using ‘synergy.conf‘ as a config file, output everything to /dev/null, and run it in the background (this is the hack part). As far as synergy is concerned, it is running in the foreground, but from the point of view of my shell, it runs it in the background.

commandline for laptop:

[0032][scott@laptop:~]$ synergyc -f --name laptop tomahawk > /dev/null 2>&1 &


Run the synergy client in the foreground, identifying itself as the computer called ‘laptop‘, connecting to the computer called ‘tomahawk‘, sending all output to /dev/null, and have bash run it in the background.

Again, if anyone can tell me how to make it properly run in the background, I’m all ears.

You may test it a bit first without the ‘ > /dev/null 2>&1 &‘ at the end of the commandline. This will allow you to see all output. When you can see that it is connecting and working, restart with this extra stuff appended. Then, you will be able to close the terminal windows without synergy shutting down.

I have actually put these commandlines into bash scripts


Once you have this bad fool running, move your mouse around between your two monitors. Copy and paste URLs and other things between the two computers. Before you know it, you’ll have a nice productive setup working for you. I wonder if you can make this thing run between two dual-head systems. Or like twelve. Talk about retinal burn-in.

In case anyone is interested, it also plays nicely with XGL/beryl, which I also have running on my laptop.

All things considered, I enjoy synergy quite a bit, and it has become indispensable for me at home. I run all my always-on stuff on my laptop (thunderbird, gaim, etc), freeing up the resources on my desktop for the tasks at hand. It works out quite nicely.

10 Responses to “Software KVM switch : synergy on Linux”

  1. Jayce^ Says:

    Not so well on mac? Funny, I’m doing it right now, and have used that as my daily system for a long time now, linux and mac, no problems whatsoever. And I repeatedly take my mac laptop between a synergy setup at work, and another at home.

  2. Scott Morris Says:

    Great, man. Glad for ya’. I was just going off what the synergy site was saying. I’m glad to hear that it does, in fact, work great for you on your Mac machines. 🙂

  3. Scott Morris Says:

    Great times, huh? Very neat tool.

  4. Mr.Gosh Says:

    Hey guys the bist is, that if i tap zwo times the upper side i jup to my mediacenter, back down to my desktop, than left out of the dualhed to my notebook!!!

    I love it!

    A bit sad, that I can`t use it for sharing my wacom between the machines because it`s absolut positioning prohibits this :/

  5. Health Says:

    Favorite Weblogs…

    […] This blog is always a nice read, and a given favorite in your feed reader […]…

  6. John Says:

    The Synergy site says the -f you’re using is forcing it to run in the foreground.
    Normally synergy wants to run “in the background.” It detaches from the terminal and doesn’t have a visible window, effectively disappearing from view. Until you’re sure your configuration works, you should start synergy “in the foreground” using the -f command line option.
    Site here:

  7. ikaruga Says:

    I know this is an old post, but I was having the same problem… thanks for the hack! BTW, w/o this hack you can’t use it on the login screen (endless loop or something like that…) Funny thing is the version on my Ubuntu box worked fine. Oh well, it works now!

  8. Tharun Says:

    This is a nice tool and article which made me curious and I tried it on my Win laptop as server and linux desktop as client. The one thing which is slightly misguiding is “Translation: pretty much a software KVM switch”. I would say it is a KM switch as each machine needs its own monitor. Very useful tool to switch between laptop and desktop but from desktop to desktop a regular KVM switch is better as it lets you use the same video for all machines. A good feature request would be to have the video on the same display.

  9. Bruce Says:

    kvm swithces can reduce alot of clutter

  10. Scott Morris Says:

    However, synergy takes up no space. That said, you still have to have room for the monitors. But hey, extra real estate is never a bad thing for me. To each his own. And Linux offers that. Thanks for stopping by!

OpenSUSE Linux Rants
Official OpenSUSE Linux Site

internal links:


SUSE Resources

search blog:


March 2022
« Feb    

60 queries. 0.328 seconds