hbeLabs.com
Bob Jones, rsjones7 at yahoo dot com
June 9, 2016

Synergy: lightdm on lubuntu 16.04 or 14.04 - before login

A disclaimer could be: "This worked or me, I'm not sure if it would work for you. synergy may be helpful, but it could also do other things to your computer. I put this page here to help me set it up each time. Perhaps it can help you too."

You can read about synergy here

This page describes my synergy setup for lightdm on lubuntu 14.04 or 16.04. I choose lightdm because it seems to be simpler than gdm and kdm.

This synergy program enables me to use one keyboard and mouse with two [or more] computers. The setup is as shown in the picture, the server is on the right and the client is on the left. The server and client are on the same private network.

I have it setup so that it starts before logging in on both server and client.

When working correctly, the server keyboard and mouse will work on both screens (one at a time, of course), even if one or both computers is sitting at the login screen. The mouse pointer moves from one screen to the other, as shown in my sketch.

I noticed that it may take a few seconds after the login screen appears before synergy actually starts working. Be a little patient.

The client mouse and keyboard should also work for the client, alone, in case synergy stops working.

To install synergy on lubuntu,

sudo apt-get install synergy

This actually installs at least two programs, synergyc for the client, and synergys for the server.

In all of the following, I use "server" and "client" as the computer names, which I think can be names made up for this program. Substitute your computer names as appropriate. I don't think IP addresses work in place of the names.

Note the synergy protocol version 1.5 apparently dropped the option --crypto-mode. It apparently still uses encryption, but only "cfb". I only use it on my private network with two [or more] computers sitting right next to each other.

Both client and server must have port 24800 (the default) open. Do this on both computers, and make sure ufw is enabled.

$ sudo ufw allow 24800
$ sudo ufw enable
$ sudo ufw status

AFTER you are all set up, if it still doesn't work, the first thing I check is to be sure the programs are running with

$ ps aux | grep synergy

If they aren't, look in the "/etc/lightdm/lightdm.conf.d/20-lubuntu.conf" file for the command, and try to run directly from the command line (replacing "--daemon" with "-f"). You can also check the logs, but it has to be running first.

Another thing to try is to run the synergy gui on both client and server to get some hints on how to set it up. You need to be logged into both computers, and you might want to kill any synergy daemon.


Note about lightdm

Lightdm people don't make it very clear (or more correctly, I haven't spent the hundreds of hours reading the lightdm manual), but older versions of lightdm seem to use "[SeatDefaults]" and newer versions seem to use "[Seat:*]".

Also, there is some confusion in me - and on the net - about where to put the configuration file so that it starts up, and at the right time.

This is what I found that works, and it applies to both the server and the client, and for both lubuntu 14.04 and 16.04.

Below, we will edit or create a config file "20-lubuntu.conf" so that synergy starts up before logging in.

That lightdm config file can go in the directory "/etc/lightdm/lightdm.conf.d/". If that directory does not exist, make it and descend into it with,

$ cd /etc/lightdm/
$ sudo mkdir lightdm.conf.d
$ cd lightdm.conf.d

When done, make sure the file "20-lubuntu.conf" has the correct ownership and permissions (since a password is stored in it),

$ sudo chmod 600 20-lubuntu.conf
$ ls 20-lubuntu.conf
-rw------- 1 root root 189 Jun 8 23:43 20-lubuntu.conf

When ready to test everything, you must restart lightdm. (Save and close all your work first!) You may either reboot the computer, or log out with

$ sudo /etc/init.d/lightdm restart

When ready, the ultimate test is to reboot both computers and see if it works from the log in screen on both computers, and when logged in to either or both computers.

Extra Note: If you want to run two [or more] programs before login (like x11vnc and synergys), I found that one should put those two [or more] commands in an actual script file, make it executable, and point to it from within the "20-lubuntu.conf" file. That is apparently because the command "greeter-setup-script" can be used only once in the lightdm configuration file. This is an example of the pairs of files needed to run both x11vnc and synergy on my server:

/usr/bin/setup.sh

/etc/lightdm/lightdm.conf.d/20-lubuntu.conf

Curiously, that does not seem to be documented anywhere. Except for this extra note, this page describes starting only synergy.


Synergy Server Setup [synergys]

My server is running Ubuntu 16.04 LTS, synergy version 1.6.2, and lightdm version 1.18.1.
"/usr/bin/lxsession -s Lubuntu -e LXDE"

The server needs a configuration file to tell it how to arrange the monitors. The client doesn't need one.

On the server computer, make the config file:

/etc/synergy.conf

Replace "server" and "client" with your own computer names.

The man page for synergys has some more detail on this configuration file. I find the "screens" and "links" sections are necessary and sufficient.

As noted above, edit or create a lightdm config file. This one seems to work for lubuntu 16.04,

/etc/lightdm/lightdm.conf.d/20-lubuntu.conf

Of course, replace "synergypasswordgoeshere" with an actual password, and "server" with your computer's actual name.

As noted above, restart lightdm and see if it is running.


Synergy Client Setup [synergyc]

My client is running ubuntu 14.04.4 LTS, synergy version 1.4.12, and lightdm version 1.10.6.
"/usr/bin/lxsession -s Lubuntu -e LXDE"

The client does not need a configuration file to tell it how to arrange the monitors.

As noted above, edit or create a lightdm config file. This one seems to work for lubuntu 14.04,

/etc/lightdm/lightdm.conf.d/20-lubuntu.conf

Of course, replace "synergypasswordgoeshere" with an actual password, and "client" with your computer's actual name.

The last parameter on the synergyc command line is the IP address of the server. That is how it finds the server on the local private network. In the example, the server IP is at 192.168.1.10, and the client IP is 192.168.1.20.

The client will try to connect to the server when synergy is running.

As noted above, restart lightdm and see if it is running.


rsjones7 at yahoo dot com