Article: Install Synergy in openSUSE 12.3 and 13.1

Updated 13 Jun '14

.
Introduction

Synergy is an application that lets you control a number of computers with the one mouse and keyboard. You can mix windows, Linux and/or Apple computers. You can have more than two computers controlled simultaneously. I describe here only how to get a Linux and a windows computer running together.

Here’s the Synergy User Guide.

I use Synergy to run only two computers side by side, one running openSUSE 12.3 and one running windows 7. Sadly I need windows operating simultaneously with Linux for my work (after all, it’s a real world out there). It would be simpler to import the windows desktop into the openSUSE screen with RDP and Rdesktop. But I need the openSUSE screen to remain uncluttered. I need to work simultaneously on both operating systems with separate screens. So I run the two computers with the one mouse & keyboard setup using Synergy.

In the description that follows, I have a windows computer with hostname win7ult960. It is the right hand member of the pair, with IP address 10.10.1.9, and it is the client machine (which means that the keyboard and mouse that control it are not physically connected to it). Next to it on the left side is the openSUSE 12.3 machine with hostname opensuse123 and with IP address 10.10.1.2, and it is the server machine (which means that the keyboard and mouse that control both it and the windows client machine are physically connected to it).

Install the RPM in openSUSE

opensuse 12.3: I got my copy from lnt-sysadmin because it appears to be a later version that the others on offer. My version is synergy-1.4.10-4.2.x86_64. Here’s the address:

http://download.opensuse.org/repositories/home:/lnt-sysadmin:/tools/openSUSE_12.3/

Click this link and retrieve the RPM and then install it: Index of /repositories/home:/lnt-sysadmin:/tools/openSUSE_12.3
You can install it various ways e.g. put it in a directory where you store RPMs and add the directory to Yast → Software Repositories and then install it using Yast → Software Management.

opensuse 13.1: use MalcolmLewis’s repo:

http://software.opensuse.org/download.html?project=home%3Amalcolmlewis%3ASLE_11_SPn_General&package=synergy

Make and Install the Synergy Configuration File

There is a bunch of example configuration files in the directory /usr/share/doc/packages/synergy/. They will tell you what to put in a config file. Here’s what I used:

# comments begin with the # character and continue to the end of
# line.  comments may appear anywhere the syntax permits.

section: screens
	# two hosts named win7ult960 and opensuse123
	win7ult960:
	opensuse123:
end

section: links
	# win7ult is to the right of opensuse123
	win7ult960:
		left = opensuse123

	opensuse123:
		right = win7ult960
end

section: aliases
	# openSUSE is sometime dicky with servernames, so I use IP addresses too
	win7ult960:
		10.10.1.9
	opensuse123:
		10.10.1.2
        opensuse123:
                 opensuse123.site
end

section: options
	screenSaverSync = false
# hotkey to lock the cursor to the screen is usually Num Lock, but see below
	keystroke(f12) = lockCursorToScreen(toggle)
end

Look at my example and the examples in /usr/share/doc/packages/synergy/. Make an appropriate file named synergy.conf and locate it at /etc/synergy.conf.

Workaround for the (openSUSE) Name Resolution Bug

For a decade that I’m aware of, Suse Linux has had difficulties with resolving hostnames to IP addresses, so it’s wise in the case of Synergy to give that a bit of assistance. Have a look at my config file synergy.conf above. See where I’ve put the IP addresses of the computers as aliases against the hostnames, like this:

section: aliases
	# openSUSE is sometime dicky with servernames, so I use IP addresses too
	win7ult960:
		10.10.1.9
	opensuse123:
		10.10.1.2

...........snip.........

I recommend that you do that too, using the right IP addresses of course. Also, I always change an entry in the file /etc/nsswitch.conf when windows computers communicate with Linux computers. There’s a line in the file that looks like this:

hosts:          files mdns_minimal [NOTFOUND=return] dns

I suggest you add “wins” in there so it looks like this:

hosts:          files mdns_minimal [NOTFOUND=return] wins dns

Those are a couple of tweaks that might be necessary.

Workaround for the (openSUSE 12.3) HOSTNAME Bug

You might get an error message when you start the Linux server with the command synergy.sh, like this:

INFO: Synergy 1.4.10 Server on Linux 3.7.10-1.1-desktop #1 SMP PREEMPT Thu Feb 28 15:06:29 UTC 2013 (82d3f21) x86_64
FATAL: unknown screen name `opensuse123.site'

I don’t know why this started happening (to me) in 12.3. It didn’t happen in 12.2. But that’s life in the free and open source world. Here’s the fix: It said there was a problem with “opensuse123.site”. I searched and found that entry in the file /etc/HOSTNAME. I don’t know why that file or that entry exists. But the problem goes away when I put the following lines into the “aliases” section of my synergy file in this form:

        opensuse123:
                 opensuse123.site

Have a look at my config file above and you’ll see exactly where I put it. If you get a similar error message coincident with the entry in the file /etc/HOSTNAME, create an “aliases” entry in synergy.conf to match it.

Allow Synergy Server Through SuSEfirewall2

Read the Userguide. The default port is TCP 24800. GoTo Yast → Security & Users → Firewall → Allowed Services and “Add” the service manually using the “Advanced” button. Put 24800 in the TCP Ports slot (Advanced button).

How You Start Synergy in openSUSE

This is only one of the several/many ways: I put the start command in a shell script and start it from the command line. Make a file called synergy.sh with these contents:

#!/bin/sh
synergys -f  --config /etc/synergy.conf

Make the file executable (chmod +x synergy.sh) and put the script(synergy.sh) in your bin folder located at /home/yourname/bin. Then you can start Synergy by invoking a console and running the command synergy.sh (In KDE I invoke with Alt+F2, type in synergy.sh and press return). Or you can simply click the file synergy.sh and it will execute and start Synergy.

Synergy in Windows

There’s a website at Synergy where you can download the windows Synergy exe version file. Be careful which link you click, there are quite a few red herrings there. Try this link for x64 machines: synergy-1.4.10-Windows-x64.exe. That’s current. When they update, you’ll have to re-locate the new link.

Install the application by mouse click on the downloaded exe file. You should notice that an “exception” is added to windows firewall during the installation, allowing the linking to take place. After the install, I found an icon for Synergy in the windows shortcuts/favourites on the start menu. If you can’t see it, you’ll find the installed application exe file located at C: \Program Files\Synergy\synergy.exe. Run synergy. A Qt window opens. Choose the Client option [Client (use another computer’s keyboard and mouse)]. Put the IP address of the openSUSE server in the slot [so that it says server IP: 10.10.1.2]. Click apply and close the panel. Next GoTo Control Panel → Admin Tools → Component Services → Services Local and find the entry for Synergy. It should read status=started, StartUpType= automatic and LogOnAs=LocalSystem.

Reboot. When windows starts again it should sit quietly waiting for the Linux server to make a link and take control. [BTW you can leave a keyboard and mouse attached to a client machine, it won’t hurt].

That’s all folks, be well

How To Configure Synergy for a Windows 8 Server & openSUSE Client

Well this time I have upgraded my win7 to win8, so when I installed Synergy on the win8, just out of curiosity I made windows the server (i.e. the kbd and mouse on windows are the operational hardware for the Linux box). It all still works just fine, and I thought you might like some tips for that configuration version.

So this time visualize a windows 8 box with hostname opti960 sitting to the left of the Linux box with the same hostname as before (opensuse123 [and accidentally also opensuse123.site]).

openSUSE Software: I used the same Repo as before, added it to yast, and installed this version: synergy-1.4.15-17.1.x86_64
Here’s the repo:

http://download.opensuse.org/repositories/home:/lnt-sysadmin:/tools/openSUSE_12.3/

Linux config file: make a conf file and locate it at /etc/synergy.conf with these contents

# comments begin with the # character and continue to the end of
# line.  comments may appear anywhere the syntax permits.

section: screens
	# two hosts named opti960 and opensuse123
	opti960:
	opensuse123:
end

section: links
	# opti960 is to the left of opensuse123
	opti960:
		right = opensuse123

	opensuse123:
		left = opti960
end

section: aliases
	# openSUSE is sometime dicky with servernames, so I use IP addresses too
	opti960:
		10.10.1.9
	opensuse123:
		10.10.1.2
	opensuse123:
		opensuse123.site
end

section: options
	screenSaverSync = false
# hotkey to lock the cursor to the screen is usually Num Lock, but see below
	keystroke(f9) = lockCursorToScreen(toggle)
end

openSUSE Firewall: This time when I set the firewall in openSUSE, I found an entry for Synergy in Yast → Firewall → Allowed Services → Synergy → add it to the panel of allowed services

Windows software: here’s the foss download page, I clicked to get 1.4.15 beta 64-bit:

http://synergy-foss.org/download/?list

Windows Server configuration

Use the GUI interface and click “Configure Server” button. Drag the blue screen in the top RH corner to sit on the correct side of the server screen and click it to configure it. When it’s all working, save the config file with File → save configuration as → name it synergy.scg and put it e.g. in C:/users/barack/synergy.scg. Then set to use it in future with the radio button “use existing configuration”. Next time you start windows it should just work.

FYI windows automatically adds synergy to the firewall and into the auto-start services list.

Start the Linux Client: make a file called synergy.sh in /home/barack/bin, make it executable and put this in it:

#!/bin/sh
synergyc -f  opti960

And you can auto-run it at boot time or just run this in a console window, or in an Alt+F2 command line: synergy.sh

Be well
swerdna
15 Nov '13