Synergy + Putty on Windows

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Introduction

Connect your linux box to your windows laptop with a single keyboard and mouse.

Getting Synergy

Synergy connects two different computers so you can slide off the screen of one and onto the other. It allows you to run two or more computers with one mouse and keyboard from one computer without hitting a button or key combination to switch.

Synergy: http://synergy2.sourceforge.net/

Download synergy for Linux on your Linux box. You distro should have it.

Download synergy for your Windows box and install it.

If you open your ports, you can allow synergy to connect directly. I don't like that, though. I prefer to do it securely.

Getting PuTTY / SSH

PuTTY: http://www.putty.nl/

PuTTY is a SSH client for windows.

Your Linux box is GUARANTEED to come with SSH. If not, you'll need to install the openssh server for your distro. (openssh-server in Fedora.)

Setting up the Synergy Server

Create a config file ~/.synergy.conf like:

section: screens
    your-linux-box.example.com:
    windows-box:
end
section: links
    your-linux-box.example.com:
        left = us-sea-23c5g81
    windows-box:
        right = us-sea-23c5g81
end

Substitute "your-linux-box.example.com" with the DNS name of your machine. If you are confused, run the "hostname" command on your linux box and use that.

Substitute "windows-box" with the name you gave your windows machine. You can see this on the bottom of the "Computer" section.

Start the server with:

$ synergys

Make sure you don't have multiple servers running. If you do, kill them all and run one.

$ ps -efwww | grep synergys
jgardner 23189     1  0 09:23 ?        00:00:00 synergys
jgardner 23196     1  1 09:23 ?        00:00:00 synergys
jgardner 23200     1  1 09:23 ?        00:00:00 synergys
jgardner 23204     1  1 09:23 ?        00:00:00 synergys
jgardner 23208 23084  0 09:23 pts/0    00:00:00 grep synergys
$ kill 23189 23196 23200 23204
$ synergys
$ ps -efwww | grep synergys
jgardner 23211     1  1 09:24 ?        00:00:00 synergys
jgardner 23215 23084  0 09:24 pts/0    00:00:00 grep synergys

Opening port forwarding

In order to do Synergy securely, you're going to tell the client box (windows) to connect to the localhost synergy server. However, you won't have a localhost server running. Instead, you'll have PuTTY listening for connections to the localhost and it will forward that across the network to the real server, your linux box. On that box, PuTTY will direct the traffic to the real synergys server, which over there is localhost at 127.0.0.1.

  1. Start up PuTTY on your windows box. It will ask you to enter all the information for the connection.
  2. Enter "username@your-linux-box.example.com" as the host.
  3. Click on the Connection - SSH - Tunnels section of the configuration.
  4. Enter "24800" in the "Source Port"
  5. Enter "127.0.0.1:24800" in the Destination Port
  6. Click "Add". You should see a line in the box that says "L24800 127.0.0.1:24800".
  7. Go to the "Session" section.
  8. Choose a session name ("my-linux-box w/ synergy tunnel", for example)
  9. Click "save"

Now you can start the session from the saved sessions. Double click on it to start it up. A SSH session should start. Enter your password. When the session starts, minimize it.

Starting the Synergys Client

On your windows box, start up Synergys. For "Other Computer's Host Name" enter "localhost". You can test it or just start it.

Problems?

If you have problems, it's because:

  1. You didn't configure your synergy server properly. Double check the names.
  2. You can't connect from PuTTY to your linux box. Check that the SSH server is running, that your SSH port is open, and that the password is correct. Check your logs for any error messages.