How to configure Synergy in six steps

What is Synergy? It’s a program that lets you share a virtual desktop between two different computers. With one mouse and keyboard, you can control two computers, and even move your mouse from one desktop to the other. It’s almost like the computers are welded together. I’ll demonstrate. This is what my desk at home looks like when my desk is clean:

Matt's desk at home in July 2007

On the left-hand monitor I have a Windows XP system running. On the right-hand monitor I run Ubuntu 7.04 (Feisty Fawn). If I move my mouse off my Windows (left) monitor to the right, it shows up on the Ubuntu (right) monitor and vice-versa. Plus cut-and-paste works between the machines as well.

Here’s how to configure Synergy with two computers. Let’s assume that you have two home machines called “windowspc” and “ubuntu”. We’ll put the Windows machine on the left and the Ubuntu machine on the right. One of the two machines will run as the Synergy server and the other will run as a Synergy client. I picked the Ubuntu machine to be the server.

  1. Install Synergy on both Ubuntu and Windows
    Ubuntu: Run the command “sudo apt-get install synergy”
    Windows: Download the .exe program from SourceForge.
  2. As root on the Ubuntu machine, create an /etc/synergy.conf file with the command “sudo vi /etc/synergy.conf”

    section: screens

    section: aliases

    section: links
    left = windowspc
    right = ubuntu

    section: options
    screenSaverSync = false
    # My KVM uses Scroll Lock to switch screens, so set the
    # hotkey to lock the cursor to the screen to something else
    keystroke(f12) = lockCursorToScreen(toggle)

    There are several things to note in this configuration file:
    – If one of your machines doesn’t have a DNS name, you can use the IP address of that machine. The “aliases” section lets you do that in a clean way. To find your IP address on Windows XP, do Start->Run, enter cmd, and type “ipconfig /all”. On Linux/Ubuntu, use “ifconfig” to find your machines’s IP address.

    – In the “links” section, you have to define both behaviors: going offscreen-left on the Ubuntu (right) machine, and going offscreen-right on the Windows (left) machine. In theory you can create really weird mappings, but keeping it simple is usually best.

    – The “screenSaverSync = false” command says not to link the screensavers of the two machines.

    – Synergy normally uses the “Scroll Lock” key as a toggle that prevents your mouse from leaving the screen. I have a KVM switch that uses the Scroll Lock key, so I redefined the “lock Cursor to Screen” key to a harmless button (f12).

  3. Make sure that the Ubuntu configuration file is world-readable. Run the command “sudo chmod a+r /etc/synergy.conf” to do that.
  4. Next, test the server and client and make sure that everything works. On the Ubuntu server, run “synergys -f --config /etc/synergy.conf” (that’s one dash in front of the ‘f’ and two dashes in front of the ‘config’). The “-f” option means “run Synergy in the foreground” and it lets you see debugging and other Synergy messages. Note that the command is “synergys” because the ‘s’ stands for server. There’s also a synergyc to run the client.

    On the Windows client, run Synergy. You’ll need to enter the name or IP address of the Ubuntu Synergy server and then click Test. The Windows program will look like this:

    Windows Synergy client

    If you’re using a KVM switch, don’t forget to shift your mouse/keyboard back to the Synergy server running on Ubuntu. The mouse/keyboard will be routed through Synergy to your Windows PC, so your KVM switch has to be set to the Synergy server.

  5. If Synergy works fine in test mode, it’s time to run it for real. On the Ubuntu server, run the command “synergys --config /etc/synergy.conf” with two dashes in front of ‘config’. That’s the same command that you ran before, except remove the “-f” option to run in the foreground. On the Windows computer, just click “Start” on the Synergy window.
  6. Finally, make Synergy run on both machines on start-up. On Windows, there’s an “Autostart” button. Click the button and choose to start Synergy either when you log in or when the computer boots up. If you have sufficient Administrator access rights, I’d set Synergy to run when the computer starts:

    Windows menu to autostart Synergy

    On the Ubuntu server, click System->Preferences->Sessions (or on more recent versions of Ubuntu, click System->Preferences->Startup Applications) and then click Add and make a startup program (I called it “Synergy Server”) that runs the command “/usr/bin/synergys --config /etc/synergy.conf“. Again, that’s two dashes in front of the word “config.”

I hope this guide helps. Once you get Synergy going, it’s incredibly cool to copy some text on the Ubuntu machine, mouse over to the Windows machine, and then paste that text on Windows.

If you want to dig into Synergy more, here are some helpful links:
Setting up and running Synergy
Setting Synergy to run automatically
Details on the configuration file format for Synergy
Frequently Asked Questions (FAQ) about Synergy
Troubleshooting Synergy

One final tip: If you’re using a KVM switch, remember which computer your keyboard/mouse is driving. That bit me a couple times.

Update: Note to myself. I defined F12 as the “lockCursorToScreen” key in the config file above. On a Microsoft Natural Ergonomic Keyboard 4000, you might have to press the “F lock” or “Flock” button and then F12 if you accidentally locked your cursor to one screen.

77 Responses to How to configure Synergy in six steps (Leave a comment)

  1. Helpful tip – please post more I.T. howtos in the future.

    Perhaps other Google senior IT pros could also share their tips

    Going to submit this to some bookmarking sites for others to learn

  2. Matt_Not_Cutts

    Nice post Matt, and a lovely example of link bait πŸ˜‰

  3. Neat

    Will have to look at that when i finaly get my pc’s sorted out at home.

    Though peronaly Id normaly just run x on my windows pc when I want to work on windows and unix using the same kb/mouse.

  4. Why have you two systems installed? Ubuntu gives you everything what you need, not?.

    I suppose that it will be to use some specific program that only is available in windows….

    I also have windows and ubuntu, and the reason is principally the photoshop.

    I still do not dominate the Gimp

  5. OT:

    Matt, I note you have an Evoluent Veritcal Mouse.

    Do you have carpal tunnel problems? I do, and it’s now expanded from my elbow into my hand as well. What a pain!

    Good luck with that.


  6. Have to say this is my favourite post of yours so far. I run a dual head setup here at home but never even considered running it between two machines. I’m definitely going to give this a go. Thanks!

  7. I agree with the above. In a million years I never would have learned about this except from your blog. Keep unique solutions you find flowing to us. Even if I don’t use this now, in a month or two it might be just what I need.
    word-camp baby!

    Hey, (looking around) it’s so quiet here, where’s Igor?

  8. Quality Post Matt :-). Its always pleasing when you take time to provide visual screenshots…..

    Ill give it a go tonight, with XP and Mac….

  9. Oh Just noticed a posible Gotcha on the IP section.

    You will have to watch the ip Matt’s setup appears to be using static ip if your using DHCP to get ip adresses you might get a problem if you ip address changes for what eaver reason.

    You should be able to force the lease so that you always get the same IP on the same MAC.


    I suspect Matt uses XP cos thats what 99% of his customers use – ive lost count of the times our developers do somthing that looks okish on FF but is borked on IE – doesn’t not go down well with the end customer.

    Any how how else will he play WOW πŸ™‚

  10. Hi Matt,

    Do you know if it is possible to run three desktops in a setup similar to this?

  11. QSven:

    As much as you like πŸ™‚
    ItΒ΄s great – and runs wirh Vista as well…
    But sometimes it breaks down with Dreamweaver. Than: reboot πŸ™

  12. I have seen this done and it is very useful as well as pretty cool. Thanks for the directions but it looks like there is not much room for error. If I was going to set this up I would probably hire someone to do it for me.

  13. Should note that it’s not an encrypted connection (last I checked). So if your doing something over say a corporate network, you may want to tunnel over SSH. Since all your keystrokes are in plain text.

  14. I love Synergy, been using it for years (or a year, I forget).

  15. Cool stuff, Matt. A buddy of mine was actually telling me about a friend of his who has 5 machines hooked up this way, and we were trying to figure out how it was done since we didn’t know of a KVM switch that could do it by itself. And now we know. Thanks, dude!

  16. Where else can you learn this. Matt thanks a bunch for sharing this. I’m going to setup the exact same this weekend πŸ™‚

  17. Matt_Not_Cutts, I wrote the article normally, then counted up the steps, then adjusted the headline just because I was curious how much of a difference it makes. πŸ™‚

    Errioxa, I’ve got a few legacy things running on my Windows computer.

    William Donelson, I just really like that mouse; it feels much better on my wrists. I also like to switch left hand and right hand mousing every few months.

    Sven, I believe you can: one Synergy server and two clients. Let us know if you get it working!

    Robert Accettura, you’d definitely want SSH if you went over the public net. I wanted to keep the example simple though, so I went with two home machines that sit behind a firewall.

    M.W.A., also KVM (keyboard-video-mouse) switches don’t handle DVI video that well. Synergy does. πŸ™‚

  18. No hardware? (except monitors?) only software? how do you connect the mouse and keyboard to both computers? I’ve found another post on this subject, but not enough info.

  19. matt, i have posted a user video about synergy a few months back, but while searching for it on youtube, i found this hilarious video:

    about it! Much better than mine and funny, because the lady does not look like a geek…. well, sort of πŸ™‚

  20. Very similar monitor set-up I have. Twin Dell 24WFPs?

    At times I feel its too much real estate – mousing over 46″ can be a PITTB – and it seems Mac Menu setup is far from ideal for multiple monitors.

    I’d love to get my PC on one of them side and will investigate. Thanks

  21. This is the first I’ve heard of Synergy, but I’ve been using a similar program for years called x2x. It’s invaluable for people who use two or more computers side-by-side — I frequently have three machines chained together. x2x only works between machines running X, but I hear there’s a x2vnc version for proxying input to non-X hosts. Synergy sounds like a continuation of this concept.

  22. Very cool.

    Is there a limit as to how many computers you can have connected?

  23. Matt, which Keyboard and Mouse are you using there? Thanks, Andreas

  24. My Linux dev box here at work isn’t dual head, so I use my windows laptop connected to an external monitor to keep documentation and other things open while coding. Synergy is a god send.

  25. I would put one of the OS’s in a virtual machine and have two displays with one computer and start off the virtual machine on the second one.

    Synergy is nice, though! If you have several computers…

  26. Even if I am not interested in this subject it is a great example of a useful “how to” guide for those who care to learn a little bit about the good honest sharing of information.

  27. lol !

    it’s so obvious you cleaned you desk just to take this picture !

    anyway … yes, I couldn’t do without my 2 screens !

  28. There’s a great program called ‘QuickSynergy’ for linux that makes setting up that side of the equation much easier to set up.

  29. Aaron,

    “it is a great example of a useful β€œhow to” guide for those who care to learn a little bit about the good honest sharing of information.”

    I second to that. Matt has been very generous in sharing valuable info on his blog.

    However, I see him not sharing with us anymore those entertaining Emmy-Oz updates πŸ˜‰

  30. Igor

    Wish you a safe and successful trip and stay in China.

    And yes. I shall miss you igorrrrrrrrrrrrrrrrrrrrrrrrrr πŸ™‚

  31. For now I’m KVM Switching it…but thanks a ton for this tutorial. I’ll definitely be giving this one a whirl.

    :thumbsup maing

  32. thats pretty cool..

  33. That’s actually really cool. You should post more stuff like this on your blog

  34. Did you configure this toy software on company time Matt? πŸ™‚
    Sure, it’s nice to have, but hardly worth the hassle.

  35. Lovely… and I thought two screens for one computer is good πŸ™‚

    Gotta try it out.

  36. Great application, I used it between MacBook and PC around christmas time if I recall correctly. Flawless, really recommend it! πŸ™‚

  37. Just make sure both client and server are using the same version. πŸ˜‰

  38. Synergy rocks! I’ve had it setup for quite awhile just like you have it Matt. Nice article, too. It sounds a lot simpler than when I remember.

  39. really cool!

  40. Nice step by step!

    Don’t think there is a limit but you may run out of room for monitors. I’m running 4 screens (XP-XP-Ubuntu-Fedora) and it’s much easier then my old setup with 4 keyboards / mice.

    Noticed your coming to wordcamp, see you there.

  41. Thanks for sharing this. Most of the people in my team have to juggle between two machines and this comes as a relief.

  42. Thanks for the configuration.
    How come that we have the same Dell monitors? would you switch?


  43. Nice article. Is this the simplist way to hook up two monitors? My brother plays online poker and wants to play 8 tables at a time which I think requires 2 monitors. Would this be the only way?

  44. Thx Matt, I listen to your instructions and succeed in hooking up two monitors. Now I think that will need to buy new dest because this one is too small. πŸ™‚

  45. I like it, but can I use it with Mac? if so how?

  46. Synergy is an awesome tool. I have discovered it on Tech TV, then I installed it on 2 PCs, one running Windows 98 (yeah, I still use one of those) and the other one running Linux/Mandriva.

    I was using my Win98 as a jukebox running a LastFm player while I worked on my Linux box. It was practical to be able to rate songs playing without having to get up and hurry to the other PC before the song stops playing.

    The installation process went out smoothly for me as well.

  47. Cut Paste from one OS to other OS ! fairly impressive…Does it also support more than 2 screens ? (I know copy paste is only done from one to other but still …) πŸ™‚

  48. Finally!

    I was searching for this about 3-4 weeks ago and never found it. I’d heard of it and its greatness. When I tried searching I couldn’t work out the correct keywords to use. I found other programs, but they didn’t work the way I wanted them too πŸ˜›

    So how did I stumble onto it here? Via someone’s link in a feed that took me to a video of Matt’s Word Camp presentation to visiting Matt’s blog and having a read.

    Thanks πŸ™‚

  49. Hi Matt,
    I wonder if someone met the following peculiar problem:
    I have 2 xp’s, both with 2 languages (US and Hebrew) and I can’t switch
    the languages when on the client. I have to move the focus back to the server for the switching to take effect.
    Any suggestions ?

  50. i have four comupters, and i have for screens, i am using a quad card on one computer and using a KVM witch oprates on one screen out of the four. how do i get synergy to work on all four computers.(when i use the KVM to switch)


  51. “As root on the Ubuntu machine, create an /etc/synergy.conf file:”

    How do you do that? I cant save anything in the etc folder. please help.

  52. Re:
    > β€œAs root on the Ubuntu machine, create an /etc/synergy.conf file:”
    > How do you do that? I cant save anything in the etc folder. please >help.

    Do “su” and enter root psw.
    Check that you don’t already have that file
    find / -name synergy.conf -print

    (I have mine at /usr/bin/synergy.conf)
    Create or update the file with e.g. “vi”

    I also have a question, that someone might be able to help me with:
    I use a WinXP as the synergy server and Linux as the client. Everything works fine except that I can’t get the screensaver sync option to work. I’ve removed the gnome screensaver and installed xscreensaver instead (as recommended elsewere), and I’ve also tried the screenSaverSync = true option in the client. In the WinXP synergy server, the syncscreensaver option i checked.

    Both screensavers work, but not the sync:ing part. Any ideas?

  53. This post was very helpful. Thanks for the information. Can you please do more informative posts such as this one? Thanks alot!

  54. Very cool application. Definately a cheap alternative to having a PS/2 switch.

  55. I just set up two computers with one mouse and keyboard. Thanks for the information and instructions Matt. I have always wanted to try Linux and also wanted to have two monitors and two computers going. Now I can watch a dvd on one computer/screen without slowing down the other computer so I can work and play at the same time very fast.

  56. Thanks dude, awesome howto.

    Got this working first try on Ubuntu 7.10 RC1

    Im going to write an ‘idiot proof’ howto based on yours if you don’t mind.

  57. I am trying to set a mac server with an xp client using apple’s computer-computer network. I have set the IP on both the mac and the PC manually and I’ve input them correctly into the config file and the PCsynergy client but whenever I try to connect on the PC it says it can’t find the server. Is there a reason that computer-computer networking wouldn’t work with this?

  58. Hi Matt:

    I’m running Synergy using OSX Leopard as the server, XP as the client, and a single monitor controlled by a KVM switch. It seems to work fine except that when I switch to the XP screen (the client), the keyboard shares just fine but the mouse only works for about 5 seconds until the cursor freezes on the screen.

    What’s funny though is that its scroll wheel still responds! just not the actual left-right-up-down movement. Any ideas?

  59. There is a wizard for setting up synergy

  60. I guess I should have taken Marc’s suggestion of hiring someone. Kicked around trying to get it to work for a couple hours. Time to put things back and perhaps try again some other time.

    Looks like a great setup. For now they will have to just be seperate. πŸ™

  61. Thanks, Matt. This is exactly what I was looking for. Had synergy working with Vista+XP, and needed to add Ubuntu into the mix. The steps you described worked perfectly. Thank you!

  62. Hi,

    Really Interesting Blogs ,
    After step for, i got this type message ,
    can i except this as how to solve this ?

    synergys -f –config /etc/synergy.conf
    INFO: synergys.cpp,1042: Synergy server 1.3.1 on Linux 2.6.24-24-generic #1 SMP Wed Apr 15 15:54:25 UTC 2009 i686
    DEBUG: synergys.cpp,1051: opening configuration “/etc/synergy.conf”
    DEBUG: synergys.cpp,1062: configuration read successfully
    FATAL: synergys.cpp,655: unknown screen name `AmSi’


  63. I’ve been looking for something similar to this setup but never really found any answers…thank you

  64. Really nice tute .. and guess what, I had exactly the same setup .. Ubuntu on the right and XP on the left. I configured synergyplus ( works great !!!

  65. Matt is a PC and Windows 7 was Matt’s Idea…

  66. Great step-by-step. Even better than Synergy’s official wiki. Just a few things to add after building up my own Ubuntu-Windows monster:

    1) On the “client” machine, you need to disable system log-in. Synergy client won’t start till you logged in. So you won’t be able to fill in the login box on the client machine.

    2) The client will have no physical keyboard connected so it’s mostly likely you will get a BIOS error when powering up. To avoid this, go to your BIOS configure and disable error message – on my Dell desktop, it is changing “all errors” to “all errors but keyboard.”

  67. Plus, it’s recommended to set your Linux machine (or Mac) as server since it is more stable…yeah, I still got crash blue screen on Windows from time to time these days…

  68. Thanks for this tutorial. Got me going quickly!

  69. Guys, I am trying to run synergy 1.3.1 on an XP box as the server and a CentOS5.5 as the client. I installed several times and I have a perfectly fine configuration file, both machines can ping each other. The firewall on the windows box is allowing the port 24800 and is having an exception for synergys and synergyc. I have tried it both ways and none of them work. Neither one works for a client nor for a server. If the windows box is the server, I get a red don’t enter/wrong way sign instead of the green synergy icon in the task bar and the status is always not running. The connection from the linux box is always timing out or getting refused. When I tried to use the linux box as the server, the log says that it is connected to the windows box but the mouse nor the keyboard never move. It records the connection only once and records entering the client once and then returning also once and never again.
    I have administrator privileges on both machines but nothing works. This is frustrating since I did have synergy working on another windows box but since I upgraded to this one it doesn’t work. It is just windows XP not VISTA nor 7.

    Any help would be appreciated. I even got the guys who are the global administrators and still using their accounts it doesn’t work at all.

    Any help is highly appreciated.

  70. After much trying Synergy worked like a charm between win7 – linux, Great post Thank you very much:
    Follow the instructions carefully!

  71. Matt: I referenced your article in updated setup instructions on my site.
    Synergy on Linux and Windows

    Since you wrote your post, an excellent utility (QuickSynergy) has been perfected that makes the Linux setup graphical, an much easier.

    Larry Bushey
    Β· Going Linux Podcast Β·

  72. One thing to point out is that the host name matters. If the host names do not match, synergy will put something in the log, but not warn you.

  73. Thank you very much for this neat demo. I just setup synergy and am very happy πŸ™‚

  74. Does anyone know how to use the synergys option: –display
    i’ve tried and can’t get it working. I’m guessing it allows users to move windows from one desktop to annother, or am I mistaken?

    i’ve searched for help all over the internet and no one else has used it before.
    I’m using 3 computers: Acer Aspire 1 – Ubuntu Netbook Edition 10.04 – 32 bit
    Some computer – Ubuntu Desktop 10.04 – 32 bit
    Dell Inspiron 1520 – Ubuntu 10.10 – 64 bit


  75. I run into some problems when I try to make the configuration file, last night when I tried that it did nothing (except display the “~” symbol a bunch of times. Now when I try to do it again I get an error about the file already being there or in use, but its not in /etc

  76. superb :0

  77. The only instructions for Synergy that I could follow and get to work. Thanks!