01
Jul
10

Of Synergy and cross-over cables

The last few months have been very eventful. I finished writing my thesis, did my thesis defense, graduated, moved, and started my new job.  I’m getting close to the end of my second week in the new position and during that time I’ve been gradually getting my office set up the way I want it.

My main work computer is a Windows 7 PC but I also have a Mac Mini that I use for cross-platform testing and other various activities.  I have two monitors attached to my PC and one connected to my Mac.  Since I have two computers but I only want to use a single keyboard and mouse, I had two options: using a KVM switch with the V part disconnected (thereby only using the keyboard and mouse) or use Synergy.

I’ve used a KVM switch before without the video switching and it’s incredibly confusing.  I’ve also used a KVM switch with video switching and it’s pretty inconvenient.  So, I decided to use Synergy.  Read on for how I got it all set up.

For the uninitiated, Synergy is a program that allows you to use a single mouse and keyboard with a number of computers.  You choose one computer to be the Synergy server and you connect your mouse and keyboard to it.  All the other computers you want to use are clients and they receive mouse and keyboard input from the server over the network.  You do some configuration to tell Synergy about the size and placement of the screens, as well as some networking stuff, and you’re all set.  When you move your mouse off the side of the screen connected to one computer, it shows up on the screen of the adjacent computer.  Keyboard input is routed to the computer containing the mouse cursor.

All in all, it’s a great system.  It’s cross-platform, so it works on Windows, Linux, Mac, etc.  It’s much less confusing than using a KVM switch without video switching and it’s much faster and easier to use than a KVM switch with video switching, since all screens are viewable simultaneously.

However, it does have one drawback: all data transferred between linked machines is sent unencrypted.  So, if I try to log in to a website on one of the client machines, my password is sent in the clear over the network.  You can set up SSH tunneling if you want, and I’ve done this in the past, but it’s a pain.

This time around, since I’m using wireless network adapters to connect both my PC and Mac to the network, I have a spare ethernet port on both machines.  This made me think that maybe I could set up Synergy to work with a cross-over cable, meaning that all my Synergy data would travel over this cable and not the university network.  If the data isn’t traveling over the main network, there’s no need to encrypt it.

Of course, the same thing could be done with a cheap network switch, and this approach would be necessary if more than 2 computers were involved.  However, I don’t have a network switch or more than 2 computers and I do have a cross-over cable, so I thought I would give it a try.

It turned out to be easy. I just configured the wired ethernet adapters on both machines with local IP addresses.  I assigned 169.254.0.1 to the Synergy server and 169.254.0.2 to the client.  I gave them both a subnet mask of 255.255.255.0 and I didn’t enter any further information – no default gateway, no DNS servers, etc.

I tried pinging each machine from the other and they found each other with no difficulty.  Of course, in this case, I was using the IP addresses I had just assigned and not the hostname of the machine on the main network.  One big upside of this approach is that the ping times are tiny.  Since these machines are connected directly, there is no other network traffic to slow down the Synergy traffic.

With the machines connected and seeing each other, I just had to install and configure Synergy.  The Windows installer is pretty good and it automates the creation of the config file.  I basically just followed the directions in the configuration utility and I looked up some stuff in the online documentation, as needed.

I did have one difficulty.  Initially, I couldn’t get my Mac to connect to the PC.  In the config file on my Windows machine I had used the name I had given my Mac.  However, the Synergy client on my Mac kept telling me that the connection attempts were being refused by the Synergy server.   It turns out that, while I had given my Mac a name manually, because it was getting its IP address via DHCP, it was getting another hostname on the network. So, I changed the hostname for the Mac in the configuration file on my Windows machine to reflect the hostname the Mac received from the DHCP server.  This fixed the problem.

With the Synergy server and client talking to each other, one thing that I needed to deal with was  the possibility that Synergy traffic would be sent over the main network despite the presence of the cross-over cable.  This can be addressed in two ways.  1) When invoking the Synergy client, you supply the hostname or IP address of the server.  So, you just make sure that you use the local (non-globally routable) IP address of the ethernet adapter on the server.  The client won’t be able to reach a local IP address over a network populated with globally routable IP addresses.  2) For an extra level of security, you can specify that the Synergy server only listens on a particular network adapter. So, I told the server to only listen for connections on the ethernet port with the local address.  Thus, it will ignore any traffic that comes in over the wireless adapter.

To verify that these measures worked, I turned off the wireless adapter on the server and tested whether the setup still worked.  It did!  As a final step, I configured the links between the monitors to deal better with the difference in size between them.  On my windows machine I have two 1680×1050 monitors in portrait orientation.  My Mac is connected to a 1280×1024 monitor in landscape orientation.  So, at the place where one of my Windows monitors meets the Mac monitor, I have 1680 pixels meeting 1024 pixels.  I just played around with the settings until it looked good.  Useful hint: 0% means the top of the screen; 100% means the bottom.

One final tip is that Synergy appears to not need to know anything about multi-monitor setups.  As far as Synergy is concerned, my Windows computer has a single monitor that is 2100 pixels wide and 1680 pixels high.  Initially, I was concerned that dealing with the two monitors on my Windows machine was going to make things hard, but it turned out to be a non-issue.  However, if, for whatever reason, you wanted to interleave monitors like (from left to right) monitor 1 from computer A, monitor 1 from computer B, monitor 2 from computer A, monitor 2 from computer B, I have no idea how to do that, if it’s even possible.

To sum up, I’m very pleased with my new set up.  It was easy to configure and it works great.  If you routinely work with more than computer, I recommend you give Synergy a try.  If your computers are at home and all the machines have local IP addresses, you probably don’t need to worry about the traffic being unencrypted.  However, if you’re at work in a large company or university like I am, it’s probably not the greatest idea to send your Synergy data over that network in the clear.  So, if you have spare network adapters and want to avoid tunneling over SSH, the approach described here might work well for you.


9 Responses to “Of Synergy and cross-over cables”


  1. November 13, 2010 at 10:40 pm

    I was having some trouble connecting synergy from my wireless iMac (server) to my wired Windows.
    I set this up at my office and it works great. Thanks :)

  2. 2 Colin
    November 14, 2010 at 3:41 pm

    I’m glad you found this helpful. I’m still using my setup regularly and I love how it blows people’s minds when they stop by my office and see my cursor move from the windows machine onto the Mac screen. It’s like magic!

  3. 3 Martin Sjåstad
    February 13, 2011 at 7:48 am

    I have tried setting up my computers with the instructions given here, but I can’t seem to get it right.
    My windows laptop is connected to my macbook with a cross-over cable, but I can’t ping the windows machine from my mac. However pinging my macbook from the windows laptop works like a charm.
    Anyone have any suggestions?

    Thanks in advance!

    • 4 Colin
      February 14, 2011 at 10:18 am

      I’m not sure what the problem is. Try turning off the Windows Firewall – it might be blocking ping attempts.

      • 5 Martin Sjåstad
        February 17, 2011 at 2:13 pm

        Yepp! Turning off the firewall let me ping the machine. Synergy actually worked, but it annoyed me that I couldn’t ping the win machine…

        Thanks for the help and the quick reply! :)

  4. 6 Alby
    April 4, 2012 at 1:37 am

    Hello. This post is really helpful! I was able to configure synergy to connect Linux and Window7.
    However, I have one problem still left unsolved. When Linux was a server, it worked perfectly fine. But I wanted Window 7 machine to be a server since i use it as my main computer. The problem is when Window 7 was a server, the Linux machine couldn’t find the Window 7 machine. Why is that?

    I am thinking maybe it has to do with Window 7’s firewall. Like above comments, I could ping the Linux machine fine from Window, but not the other way around. Also on Window side, the network is identified as “Unidentified Network”. Do you have any advice on this?

    Thank you
    Alby

    • 7 Colin
      January 28, 2013 at 11:46 am

      Sorry I didn’t get back to you on this. Did you get it figured out?

      The “network” associated with the cross-over cable connection to your other machine will probably be called “Unidentified Network” in Windows. This is fine. On my computer, it says “Unidentified Network, No Internet Access”. With normal network connections, the “No Internet Access” part would be bad, but, in this case, it’s a good thing – you don’t want your unencrypted Synergy traffic getting to the internet.

  5. January 28, 2013 at 8:20 am

    Worked like a charm for me :-)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


Calendar

July 2010
S M T W T F S
« Jan   Oct »
 123
45678910
11121314151617
18192021222324
25262728293031

Recent Twitterings

Follow Me on Twitter

RSS That to which I am listening

  • An error has occurred; the feed is probably down. Try again later.

%d bloggers like this: