Project

General

Profile

Support #593

Updated by Daniel Curtis over 8 years ago

{{>toc}} 

 I use Arch Linux for my primary workstation OS, however I also have Ubuntu derivative workstations that I occasionally need to access. To make life easier I have one workstation that only has a monitor and network connection and I share my mouse and keyboard from my Arch laptop to with my other Ubuntu-based workstation using synergy. This is a guide to set up sharing a mouse and keyboard on Arch Linux with an Ubuntu client using synergy. 

 *NOTE*: This guide has DNS records for workstation1 (Arch) and workstation2 (Ubuntu); if DNS is unavailable, then add IP addresses for the workstations in @/etc/hosts@. 

 h2. Setting Up The Synergy Server on Arch 

 * Install synergy: 
 <pre> 
 sudo pacman -S synergy 
 </pre> 

 * Create a new configuration file: 
 <pre> 
 sudo cp /etc/synergy.conf.example /etc/synergy.conf 
 </pre> 

 * Edit the synergy server config file: 
 <pre> 
 sudo nano /etc/synergy.conf 
 </pre> 
 #* And modify the config accordingly: 
 <pre> 
 section: screens 
         # Define two screen hosts named workstation1 and workstation2 
         workstation1: 
         workstation2: 
 end 

 section: links 
         # Set workstation2 above workstation1 
         workstation1: 
                 up      = workstation2 

         # Set workstation1 below workstation2 
         workstation2: 
                 down    = workstation1 
 end 
 </pre> 


 * Test the server in the foreground, you can run the following command instead: 
 <pre> 
 synergys -f 
 ^C 
 </pre> 

 * The synergy server process needs to attach to your user's X session, which means it needs to run as your user. Enable it as the appropriate user: 
 <pre> 
 systemctl enable synergys@user 
 systemctl start synergys@user 
 </pre> 

 h2. Setting Up The Synergy Client on Ubuntu 

 * Install synergy: 
 <pre> 
 sudo apt-get install synergy 
 </pre> 

 * My system is setup to automatically log in, so I added a simple start up application by going to +System -> Preferences -> Startup Applications+ and click *Add*: 
 #* Name: *Synergy Client* 
 #* Command: *@/usr/bin/synergyc -f workstation1@* 
 #* Comment: *Connect to workstation1 keyboard/mouse* 
 #* *Save* 

 h2. Setting Up The Synergy Client on Arch 

 * Connect to the synergy server manually: 
 <pre> 
 synergyc workstation1 
 </pre> 

 h3. Synergy With Systemd 

 * To start the Synergy client with systemd, create a service file:  
 <pre> 
 vi /etc/systemd/system/synergyc@.service 
 </pre> 
 #* And add the following: 
 <pre> 
 [Unit] 
 Description=Synergy Client Daemon 
 After=network.target 

 [Service] 
 EnvironmentFile=/etc/conf.d/synergyc.conf 
 ExecStart=/usr/bin/synergyc --no-daemon --debug ${DEBUGLEVEL:-INFO} ${SERVERALIAS} 
 User=%i 

 [Install] 
 WantedBy=multi-user.target 
 </pre> 

 * And optionally a config file:  
 <pre> 
 vi /etc/conf.d/synergyc.conf 
 </pre> 
 #* And add the following: 
 <pre> 
 DEBUGLEVEL=WARNING 
 SERVERALIAS=workstation1 
 </pre> 

 * To start the service for your user, 
 <pre> 
 systemctl start synergyc@user 
 </pre> 

 h2. Resources 

 * https://wiki.archlinux.org/index.php/Synergy 
 * http://askubuntu.com/questions/15212/start-synergy-on-boot

Back