• Home
  • About
  • Archives
  • Books
  • Colophon
  • Policies
  • Resume
  • Tumblr

zanshin.net

because not enough websites start with the letter “Z”

Feed on
Posts
Comments
Tumblr
« 50,000
How to Use Facebook Via RSS »

Using Synergy Over a Secure Connection

Dec 10th, 2009 by mark

At work I now have four computers and five screens, all controlled from one keyboard and mouse. Here’s how I did it.

Hardware

The primary machine at work is a Mac Pro running Mac OS X 10.6.2 with 2 x 2.66 GHz Dual-Core Intel Xeon processors, and 4 GB of 667 MHz DDR2 RAM. This machine has two 20″ Apple Cinema displays attached to it, and an Apple Keyboard and an Apple Mighty Mouse. This machine is called Palantir.

The work supplied laptop is a 15″ MacBook Pro also running Mac OS X 10.6.2 with a 2.4 GHz Intel Core 2 Duo processor and 2 GB of 67 MHz DDR2 RAM. This machine is called Orthanc.

The final machine in the mix is my personal MacBook Pro running Mac OS 10.6.2 on an 2.66 GHz Intel Core 2 Duo with 4 GB of 1067 MHz DDR3 RAM. This machine is called BlackPerl.

I also have a Dell Precision 390 running Windows 7 Professional, it has an Intel Core2 Quad CPU running at 2.4 GHz, and 2 GB of RAM. It’s called Khazad-dum. This machine doesn’t actively participate in the Synergy setup, it’s accessed via Remote Desktop from my Mac Pro.

Software

According to their web site, 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).

In addition to Mac OS X, Synergy supports Windows (95 through XP), and Unix, Linux, and Solaris.

Setup

Synergy consists of two parts, a server (the machine with the keyboard and mouse) and one or more clients (those machines you wish to control through the same keyboard and mouse). The server machine utilizes a configuration file to describe the geometry of your various computers. In my case I have things arranged like this, from left to right, on my desk:

  • BlackPerl (Personal MBP)
  • Palantir (Mac Pro)
  • Orthanc (Work MBP)

So my Synergy configuration file looks like this:

# synergy configuration file
 
section: screens
	# three hosts:
	#	Palantir (Mac Pro)
	# 	Orthanc (MacBook Pro)
	#	BlackPerl (MacBook Pro)
	#
	# arranged from left to right: BlackPerl : Palantir : Orthanc
	#
	BlackPerl:
	Palantir:
	Orthanc:
end
 
section: links
	# Palantir is to the right of BlackPerl
	BlackPerl:
		right = Palantir
	# BlackPerl is to the left of Palantir,
	# Orthanc is to the right of Palantir
	Palantir:
		left = BlackPerl
		right = Orthanc
	# Palantir is to the left of Orthanc
	Orthanc:
		left = Palantir
end
 
section: aliases
	# Palantir has an alias
	Palantir:
		localhost
end
 
section: options
	# use control+alt+# to hop to screen directly
	# 1 = BlackPerl
	# 2 = Palantir
	# 3 = Orthanc
	keystroke(control+alt+1) = switchToScreen(BlackPerl)
	keystroke(control+alt+2) = switchToScreen(Palantir)
	keystroke(control+alt+3) = switchToScreen(Orthanc)
end

This configuration is saved in my home directory as .synergy.conf.

While you could manually start the server each time you wanted to use Synergy, a better solution is to have it started automatically each time the computer is restarted or booted. Using Lingon I was able to create a launchd plist for Synergy that starts the server component automatically. My net.sourceforge.synergy2.plist looks like this:

synergy2Once this file is created, Synergy will start automatically every time the machine is booted. This creates the server necessary for Synergy to work.

On each client machine I added a function to my .bashrc file to create a secure shell connection to the machine with the Synergy server, in my case called Palantir. The function looks like this:

function pssh() { ssh -L 24800:localhost:24800 userid@palantir.example.com }

What is happening here is that port 24800 on the local machine is being forwarded to the same port on the remote machine (Palantir). All traffic to port 24800 will be encrypted and passed along to the other machine.

In addition to that function, each client machine also has a second .bashrc funtion called syn, that starts the Synergy client over the port forwarding created by the first function. It looks like this:

function syn() { /Users/username/bin/synergy-1.3.1/synergyc -f --name clientName localhost }

This function starts the Synergy client (synergyc) and names the client machine (–name clientName) and points it at localhost as the server. Since the Synergy port (24800) is port forwarded to the server machine, pointing the client at localhost works.

How to Use

With the Synergy server always running on my Mac Pro it is easy to start Synergy on both client machines. I open up a new Terminal tab and run the port forwarding function first (pssh). This function results in your being signed into the server, and this connection must exist in order for Synergy to work.

Next, open a new tab, which will give you a prompt on the client machine, and run the syn function to start the Synergy client. This tab will record the output generated by Synergy as you move into and out of the client via the host’s mouse.

I have discovered that Synergy is persistent; as long as the client is running and the port forwarding exists your client machine will respond to actions happening on the server. For example: if I take one of the laptops to a meeting without breaking the Synergy connection, and the screen saver starts on the server, the screen saver will be activated on the client too. This is a very minor downside as it is easy to Cmd-Tab to the Terminal instance with the Synergy tabs, and Ctrl-C out of the Synergy client and exit from the remote connection.

Notes

Synergy seems to be a dead project. No updates have happened to its source in a long time. Also, this setup which worked flawlessly under Mac OS 10.4, and 10.5, seems to be a bit flakier under 10.6. If you aren’t interested in this much effort to build a secure connection for Synergy you might want to look at Teleport, an alternative for accessing multiple computers from one keyboard and mouse.

Also, the launchd plist creation software, Lingon, is no longer being supported either.

Tags: howto, kvm, software

Posted in nerdliness

Comments are closed.

  • Welcome!

    Mark H. Nichols is a software architect, martial artist, nerd, cellist, and all around good guy. He works at Kansas State University in Manhattan Kansas, and lives with his wife, two cats, a pair of 7-foot Kawai concert grand pianos, a violoncello, nearly a dozen computers, and a 2010 Honda Insight EX. You can read more about Mark, and this site, or explore the archives.
  • last 3 tweets

    • Previous RT originally by @AaronBillard: 06:22:41 PM September 08, 2010 from Tweetie for Mac
    • RT I love how the earth has stopped spinning long enough for the major religions of the world to hold hands and say Terry Jones is an arse. 06:22:22 PM September 08, 2010 from Tweetie for Mac
    • There should be a proficiency exam before one is allowed to use the self check out lane. #walmart 12:22:26 AM September 08, 2010 from Twitter for Android
    • I just earned the Ranger Pin on @gowalla! http://gowal.la/r/25VbN 04:25:01 PM September 06, 2010 from Gowalla
    • The annual cricket invasion has begun. *crickets* 12:28:08 PM September 06, 2010 from Tweetie for Mac
    • No matter how much it changes, it's still your home town. 10:41:49 PM September 04, 2010 from Twitter for Android
    • Absolutely despise florescent lights. Especially early in the morning. Or afternoon. Evenings. Nighttime. Pretty much all the time. #gah 12:55:54 PM September 02, 2010 from Tweetie for Mac
    • @timbray We've used a Tchibo USB Internet Stick with prepaid data with some success in Stuttgart. Customer Service is nonexistent however. 01:34:03 PM September 01, 2010 from Tweetie for Macin reply to timbray
    • RT @timbray: A story of O: http://www.tbray.org/ongoing/When/201x/2010/08/31/A-Story-of-O 02:37:53 AM September 01, 2010 from Tweetie for Mac
    • Manual Froyo update went smoothly. First boot takes a *very* long time with several lengthy pauses. Patience pays off. http://bit.ly/9VyNdR 02:16:01 PM August 31, 2010 from Tweetie for Mac
  • Most Popluar

    • Installing PostgreSQL on Mac 10.6 (Snow Leopard)
    • Using jQuery to Create iGoogle Style Drag-and-Drop
    • geek. : nerdliness is next to godliness
    • Using SSHFS, MacFUSE, and Macfusion to Access Remote Filesystems
    • Solfège
    • Installing Tchibo Internet Stick on Mac OS X
    • Using CRON to Control TimeMachine Backups
    • Mac OS X 10.6.4 Update Fails
    • Flickr Upload Via Command Line
  • Categories

    • diversions
    • elsewhere
    • family
    • health
    • life
    • links
    • meme
    • nerdliness
    • photography
    • random
    • relationships
    • social issues
  • Archives

    • Blogroll

      • Change.gov
      • Elfenbein Klaviermusik Notes
      • Shawn Blanc
      • Sibylle Kuder

zanshin.net © 1996 - 2010 All Rights Reserved.

Policies | Web Hosting: Blue Host