特殊:Badtitle/NS100:SynergyHowto:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的7个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/SynergyHowto}} | {{From|https://help.ubuntu.com/community/SynergyHowto}} | ||
{{Languages|UbuntuHelp:SynergyHowto}} | {{Languages|UbuntuHelp:SynergyHowto}} | ||
Synergy is a program that will let you use one keyboard and mouse on multiple computers across a network. The computers can be running Linux, Windows, or MacOS. The computer with the keyboard and mouse is the '''server''' or '''host''', and the computers with the displays to be controlled remotely are the '''clients'''. In this HOWTO I will let you know how to get Synergy setup and running on your Ubuntu system. | |||
Warning! Achtung! Synergy is not very secure at all! Consider - you are setting up something to allow an entirely different computer control the keyboard and mouse on your own computer! Don't try and use this anywhere unsecure! There is a way of making it more secure by running it over OpenSSH, but that is currently beyond the scope of this article. | Warning! Achtung! Synergy is not very secure at all! Consider - you are setting up something to allow an entirely different computer control the keyboard and mouse on your own computer! Don't try and use this anywhere unsecure! There is a way of making it more secure by running it over OpenSSH, but that is currently beyond the scope of this article. More documentation is available on the [http://synergy2.sourceforge.net/ Synergy website]. | ||
=== Quickstart Guide === | |||
There is a graphical tool available in the universe repositories for easily configuring and starting Synergy on both server and client computer called QuickSynergy. If you don't already know either the hostname of these computers, run the <code><nowiki>hostname</nowiki></code> command from a [[UbuntuHelp:UsingTheTerminal|Terminal window]]. | |||
==== On the Client(s) ==== | |||
Follow these steps on the computer you would like to control with a remote keyboard and mouse. | |||
=== | <ol><li>[[UbuntuHelp:apt:quicksynergy|Install QuickSynergy]] and open it (under Applications > Accessories) | ||
</li><li>Under the 'Use' tab, type the hostname or IP address of the Host machine in the IP field, and the hostname of the Client machine in the Screen field. | |||
</li><li>Click Execute</li></ol> | |||
==== On the Server ==== | |||
Follow these steps on the computer with the keyboard and mouse. | |||
=== | <ol><li>[[UbuntuHelp:apt:quicksynergy|Install QuickSynergy]] and open it (under Applications > Accessories) | ||
</li><li>Under the 'Share' tab enter the hostname or IP address of the Client machines in one of the directional boxes. The directional box you choose will determine which edge of the Host computer's screen the mouse will "run off". | |||
</li><li>Click Execute | |||
< | </li><li>Move the mouse to the edge of the Host screen -- it should now appear on the client screen.</li></ol> | ||
</ | === Manual Configuration === | ||
=== | The following steps assume you are setting up synergy on a host computer named '''myserver''' and a client computer named '''myclient'''. | ||
==== On the Server ==== | |||
Synergy configuration can go in your home folder called '''.synergy.conf''' or in '''/etc/synergy.conf'''. It is up to you whether you would like the changes to be per-user or system-wide. | |||
Here is a sample configuration that will be the needs of 95% of users: | |||
< | |||
</ | |||
< | |||
</ | |||
</ | |||
=== | |||
=== Server | |||
synergy.conf | |||
Here is a | |||
<pre><nowiki> | <pre><nowiki> | ||
section: screens | section: screens | ||
myserver: | |||
myclient: | |||
end | end | ||
section: links | section: links | ||
myserver: | |||
right = | right = myclient | ||
myclient: | |||
left = | left = myserver | ||
end | end | ||
</nowiki></pre> | </nowiki></pre> | ||
'''myserver''' is the hostname of the computer running synergys (providing the keyboard and mouse) | |||
''' | '''myclient''' is the hostneme of the computer running synergyc (using the keyboard and mouse provided by myserver) | ||
''' | '''section: screens''' is where you set the host names of the computers going to be used. | ||
''' | '''section: links''' is what side the mouse will leave the screen of one computer to reach the desktop of the other. '''myserver''' is set to the left of '''myclient''', so when I drag the mouse off the right hand side of '''myserver''''s screen it appears on the left hand side '''myclient''''s screen. Use '''up'''/'''down''' instead of '''left'''/'''right''' to establish and over/under sort of relationship. | ||
==== Running Synergy ==== | |||
''' | From the server, run the command: | ||
=== | <pre><nowiki> | ||
synergys | |||
=== | </nowiki></pre> | ||
From the client, run the command: | |||
<pre><nowiki> | |||
synergyc <SERVER HOSTNAME> | |||
</nowiki></pre> | |||
Replacing <SERVER HOSTNAME> with either the hostname ('''myclient''') or IP address of '''myclient'''. | |||
You should now be able to move your mouse pointer off the right edge of your server's screen and see it show up at the left side of your client's screen. See the steps in the next section to make synergy start automatically on the host and client computers. | |||
If you have any problems at this point it is helpful to run synergys and synergyc in the foreground with the '''-f''' option. This allows you to see error/status information that synergy prints to the terminal. | |||
=== Autostart Synergy after logging in (GNOME) === | |||
==== On the Server ==== | |||
Follow these steps to start synergys when you log into GNOME. | |||
Go to System Menu > Preferences > Startup Applications. Click "Add" and enter | |||
<code><nowiki>synergys</nowiki></code> | |||
Click OK and Close. | |||
=== Autostart Synergy before logging in (GDM) === | |||
Note: Autostarting Synergy before logging in requires that your network connection be available at all times and not just after you log in. This is accomplished by enabling the network connection for all users. To do this, choose System->Preference->Network Connections. Choose the network name and select Edit. Select "Available to all users", and then click "Apply". This connection will now be available at all times, including at the GDM login screen. | |||
To make sure synergy is running at all times, the following has to happen: First, synergy is started when the GDM login screen starts. Then, synergy is killed and restarted when a user logs in. When the user logs out, synergy is killed and GDM starts it again. To edit system configuration files in the following sections open a text editor as the root user: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo gedit | |||
</nowiki></pre> | </nowiki></pre> | ||
==== On the Server ==== | |||
At the end of the file <code><nowiki>/etc/gdm/Init/Default</nowiki></code>, just before the line that says <code><nowiki>exit 0</nowiki></code> add the following: | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergys | |||
while [ $(pgrep -x synergys) ]; do sleep 0.1; done | |||
/usr/bin/synergys | |||
</nowiki></pre> | </nowiki></pre> | ||
Add the following to the end of <code><nowiki>/etc/gdm/PostLogin/Default</nowiki></code> (create this file file if it does not already exist): | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergys | |||
while [ $(pgrep -x synergys) ]; do sleep 0.1; done | |||
</nowiki></pre> | </nowiki></pre> | ||
If you created the file, make sure it is executable with this command: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo chmod +x /etc/gdm/PostLogin/Default | |||
</nowiki></pre> | </nowiki></pre> | ||
Now, create a session file <code><nowiki>/etc/X11/Xsession.d/85synergys</nowiki></code> with the following contents | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergys | |||
while [ $(pgrep -x synergys) ]; do sleep 0.1; done | |||
/usr/bin/synergys | |||
</nowiki></pre> | </nowiki></pre> | ||
Lastly, we must make the file executable with this command: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo chmod +x /etc/X11/Xsession.d/85synergys | |||
/ | |||
</nowiki></pre> | </nowiki></pre> | ||
==== On the Client ==== | |||
At the end of <code><nowiki>/etc/gdm/Init/Default</nowiki></code>, just before the line that says <code><nowiki>exit 0</nowiki></code> add the following: | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergyc | /usr/bin/killall synergyc | ||
sleep 1 | while [ $(pgrep -x synergyc) ]; do sleep 0.1; done | ||
/usr/bin/synergyc | /usr/bin/synergyc <SERVER HOSTNAME> | ||
</nowiki></pre> | </nowiki></pre> | ||
Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys. | |||
Add the following to the end of <code><nowiki>/etc/gdm/PostLogin/Default</nowiki></code> (create this file file if it does not already exist): | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergyc | /usr/bin/killall synergyc | ||
while [ $(pgrep -x synergyc) ]; do sleep 0.1; done | |||
</nowiki></pre> | </nowiki></pre> | ||
If you created the file, make sure it is executable with this command: | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo chmod +x /etc/gdm/PostLogin/Default | |||
/ | |||
</nowiki></pre> | </nowiki></pre> | ||
Now, create a session file <code><nowiki>/etc/X11/Xsession.d/85synergyc</nowiki></code> with the following contents | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergyc | |||
while [ $(pgrep -x synergyc) ]; do sleep 0.1; done | |||
/usr/bin/synergyc <SERVER HOSTNAME> | |||
/usr/bin/killall | |||
</nowiki></pre> | </nowiki></pre> | ||
This will run synergyc when any user logs in. Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys. Lastly, we must make the file executable with this command: | |||
This | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo chmod +x /etc/X11/Xsession.d/85synergyc | |||
</nowiki></pre> | </nowiki></pre> | ||
==== Client | === Autostart Synergy before logging in (KDM) === | ||
==== On the Client ==== | |||
Add the following to `/etc/kde3/kdm/Xsetup`: | Follow these steps to start the synergyc client when the KDM login screen launches. | ||
Add the following to the end of `/etc/kde3/kdm/Xsetup`: | |||
<pre><nowiki> | <pre><nowiki> | ||
/usr/bin/killall synergyc | /usr/bin/killall synergyc | ||
sleep 1 | sleep 1 | ||
/usr/bin/synergyc | /usr/bin/synergyc <SERVER HOSTNAME> | ||
</nowiki></pre> | </nowiki></pre> | ||
For the client file we must also edit the Xstartup script to kill our | Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys. | ||
For the client file we must also edit the Xstartup script to kill our synergyc process running as root before the user Xsession scripts run. To do this add the following to the end of `/etc/kde3/kdm/Xstartup` and it should look like this: | |||
<pre><nowiki> | <pre><nowiki> | ||
#! /bin/sh | #! /bin/sh | ||
第312行: | 第156行: | ||
fi | fi | ||
</nowiki></pre> | </nowiki></pre> | ||
=== See Also === | |||
[http://synergy2.sourceforge.net/ Synergy Homepage] | |||
[http://code.google.com/p/quicksynergy/ QuickSynergy Homepage] | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月20日 (四) 00:21的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/SynergyHowto }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/af | • {{#if: UbuntuHelp:SynergyHowto|Afrikaans| [[::SynergyHowto/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ar | • {{#if: UbuntuHelp:SynergyHowto|العربية| [[::SynergyHowto/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/az | • {{#if: UbuntuHelp:SynergyHowto|azərbaycanca| [[::SynergyHowto/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/bcc | • {{#if: UbuntuHelp:SynergyHowto|جهلسری بلوچی| [[::SynergyHowto/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/bg | • {{#if: UbuntuHelp:SynergyHowto|български| [[::SynergyHowto/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/br | • {{#if: UbuntuHelp:SynergyHowto|brezhoneg| [[::SynergyHowto/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ca | • {{#if: UbuntuHelp:SynergyHowto|català| [[::SynergyHowto/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/cs | • {{#if: UbuntuHelp:SynergyHowto|čeština| [[::SynergyHowto/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/de | • {{#if: UbuntuHelp:SynergyHowto|Deutsch| [[::SynergyHowto/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/el | • {{#if: UbuntuHelp:SynergyHowto|Ελληνικά| [[::SynergyHowto/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/es | • {{#if: UbuntuHelp:SynergyHowto|español| [[::SynergyHowto/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/fa | • {{#if: UbuntuHelp:SynergyHowto|فارسی| [[::SynergyHowto/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/fi | • {{#if: UbuntuHelp:SynergyHowto|suomi| [[::SynergyHowto/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/fr | • {{#if: UbuntuHelp:SynergyHowto|français| [[::SynergyHowto/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/gu | • {{#if: UbuntuHelp:SynergyHowto|ગુજરાતી| [[::SynergyHowto/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/he | • {{#if: UbuntuHelp:SynergyHowto|עברית| [[::SynergyHowto/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/hu | • {{#if: UbuntuHelp:SynergyHowto|magyar| [[::SynergyHowto/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/id | • {{#if: UbuntuHelp:SynergyHowto|Bahasa Indonesia| [[::SynergyHowto/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/it | • {{#if: UbuntuHelp:SynergyHowto|italiano| [[::SynergyHowto/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ja | • {{#if: UbuntuHelp:SynergyHowto|日本語| [[::SynergyHowto/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ko | • {{#if: UbuntuHelp:SynergyHowto|한국어| [[::SynergyHowto/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ksh | • {{#if: UbuntuHelp:SynergyHowto|Ripoarisch| [[::SynergyHowto/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/mr | • {{#if: UbuntuHelp:SynergyHowto|मराठी| [[::SynergyHowto/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ms | • {{#if: UbuntuHelp:SynergyHowto|Bahasa Melayu| [[::SynergyHowto/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/nl | • {{#if: UbuntuHelp:SynergyHowto|Nederlands| [[::SynergyHowto/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/no | • {{#if: UbuntuHelp:SynergyHowto|norsk| [[::SynergyHowto/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/oc | • {{#if: UbuntuHelp:SynergyHowto|occitan| [[::SynergyHowto/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/pl | • {{#if: UbuntuHelp:SynergyHowto|polski| [[::SynergyHowto/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/pt | • {{#if: UbuntuHelp:SynergyHowto|português| [[::SynergyHowto/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ro | • {{#if: UbuntuHelp:SynergyHowto|română| [[::SynergyHowto/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/ru | • {{#if: UbuntuHelp:SynergyHowto|русский| [[::SynergyHowto/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/si | • {{#if: UbuntuHelp:SynergyHowto|සිංහල| [[::SynergyHowto/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/sq | • {{#if: UbuntuHelp:SynergyHowto|shqip| [[::SynergyHowto/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/sr | • {{#if: UbuntuHelp:SynergyHowto|српски / srpski| [[::SynergyHowto/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/sv | • {{#if: UbuntuHelp:SynergyHowto|svenska| [[::SynergyHowto/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/th | • {{#if: UbuntuHelp:SynergyHowto|ไทย| [[::SynergyHowto/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/tr | • {{#if: UbuntuHelp:SynergyHowto|Türkçe| [[::SynergyHowto/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/vi | • {{#if: UbuntuHelp:SynergyHowto|Tiếng Việt| [[::SynergyHowto/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/yue | • {{#if: UbuntuHelp:SynergyHowto|粵語| [[::SynergyHowto/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/zh | • {{#if: UbuntuHelp:SynergyHowto|中文| [[::SynergyHowto/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/zh-hans | • {{#if: UbuntuHelp:SynergyHowto|中文(简体)| [[::SynergyHowto/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:SynergyHowto | UbuntuHelp:SynergyHowto | {{#if: | :}}SynergyHowto}}/zh-hant | • {{#if: UbuntuHelp:SynergyHowto|中文(繁體)| [[::SynergyHowto/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:SynergyHowto|:SynergyHowto|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :SynergyHowto/zh | | {{#ifexist: SynergyHowto/zh | | {{#ifeq: {{#titleparts:SynergyHowto|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SynergyHowto|1|-1|}} | zh | | }}
Synergy is a program that will let you use one keyboard and mouse on multiple computers across a network. The computers can be running Linux, Windows, or MacOS. The computer with the keyboard and mouse is the server or host, and the computers with the displays to be controlled remotely are the clients. In this HOWTO I will let you know how to get Synergy setup and running on your Ubuntu system. Warning! Achtung! Synergy is not very secure at all! Consider - you are setting up something to allow an entirely different computer control the keyboard and mouse on your own computer! Don't try and use this anywhere unsecure! There is a way of making it more secure by running it over OpenSSH, but that is currently beyond the scope of this article. More documentation is available on the Synergy website.
Quickstart Guide
There is a graphical tool available in the universe repositories for easily configuring and starting Synergy on both server and client computer called QuickSynergy. If you don't already know either the hostname of these computers, run the hostname
command from a Terminal window.
On the Client(s)
Follow these steps on the computer you would like to control with a remote keyboard and mouse.
- Install QuickSynergy and open it (under Applications > Accessories)
- Under the 'Use' tab, type the hostname or IP address of the Host machine in the IP field, and the hostname of the Client machine in the Screen field.
- Click Execute
On the Server
Follow these steps on the computer with the keyboard and mouse.
- Install QuickSynergy and open it (under Applications > Accessories)
- Under the 'Share' tab enter the hostname or IP address of the Client machines in one of the directional boxes. The directional box you choose will determine which edge of the Host computer's screen the mouse will "run off".
- Click Execute
- Move the mouse to the edge of the Host screen -- it should now appear on the client screen.
Manual Configuration
The following steps assume you are setting up synergy on a host computer named myserver and a client computer named myclient.
On the Server
Synergy configuration can go in your home folder called .synergy.conf or in /etc/synergy.conf. It is up to you whether you would like the changes to be per-user or system-wide. Here is a sample configuration that will be the needs of 95% of users:
section: screens myserver: myclient: end section: links myserver: right = myclient myclient: left = myserver end
myserver is the hostname of the computer running synergys (providing the keyboard and mouse) myclient is the hostneme of the computer running synergyc (using the keyboard and mouse provided by myserver) section: screens is where you set the host names of the computers going to be used. section: links is what side the mouse will leave the screen of one computer to reach the desktop of the other. myserver is set to the left of myclient, so when I drag the mouse off the right hand side of myserver's screen it appears on the left hand side myclient's screen. Use up/down instead of left/right to establish and over/under sort of relationship.
Running Synergy
From the server, run the command:
synergys
From the client, run the command:
synergyc <SERVER HOSTNAME>
Replacing <SERVER HOSTNAME> with either the hostname (myclient) or IP address of myclient. You should now be able to move your mouse pointer off the right edge of your server's screen and see it show up at the left side of your client's screen. See the steps in the next section to make synergy start automatically on the host and client computers. If you have any problems at this point it is helpful to run synergys and synergyc in the foreground with the -f option. This allows you to see error/status information that synergy prints to the terminal.
Autostart Synergy after logging in (GNOME)
On the Server
Follow these steps to start synergys when you log into GNOME.
Go to System Menu > Preferences > Startup Applications. Click "Add" and enter
synergys
Click OK and Close.
Autostart Synergy before logging in (GDM)
Note: Autostarting Synergy before logging in requires that your network connection be available at all times and not just after you log in. This is accomplished by enabling the network connection for all users. To do this, choose System->Preference->Network Connections. Choose the network name and select Edit. Select "Available to all users", and then click "Apply". This connection will now be available at all times, including at the GDM login screen. To make sure synergy is running at all times, the following has to happen: First, synergy is started when the GDM login screen starts. Then, synergy is killed and restarted when a user logs in. When the user logs out, synergy is killed and GDM starts it again. To edit system configuration files in the following sections open a text editor as the root user:
sudo gedit
On the Server
At the end of the file /etc/gdm/Init/Default
, just before the line that says exit 0
add the following:
/usr/bin/killall synergys while [ $(pgrep -x synergys) ]; do sleep 0.1; done /usr/bin/synergys
Add the following to the end of /etc/gdm/PostLogin/Default
(create this file file if it does not already exist):
/usr/bin/killall synergys while [ $(pgrep -x synergys) ]; do sleep 0.1; done
If you created the file, make sure it is executable with this command:
sudo chmod +x /etc/gdm/PostLogin/Default
Now, create a session file /etc/X11/Xsession.d/85synergys
with the following contents
/usr/bin/killall synergys while [ $(pgrep -x synergys) ]; do sleep 0.1; done /usr/bin/synergys
Lastly, we must make the file executable with this command:
sudo chmod +x /etc/X11/Xsession.d/85synergys
On the Client
At the end of /etc/gdm/Init/Default
, just before the line that says exit 0
add the following:
/usr/bin/killall synergyc while [ $(pgrep -x synergyc) ]; do sleep 0.1; done /usr/bin/synergyc <SERVER HOSTNAME>
Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys.
Add the following to the end of /etc/gdm/PostLogin/Default
(create this file file if it does not already exist):
/usr/bin/killall synergyc while [ $(pgrep -x synergyc) ]; do sleep 0.1; done
If you created the file, make sure it is executable with this command:
sudo chmod +x /etc/gdm/PostLogin/Default
Now, create a session file /etc/X11/Xsession.d/85synergyc
with the following contents
/usr/bin/killall synergyc while [ $(pgrep -x synergyc) ]; do sleep 0.1; done /usr/bin/synergyc <SERVER HOSTNAME>
This will run synergyc when any user logs in. Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys. Lastly, we must make the file executable with this command:
sudo chmod +x /etc/X11/Xsession.d/85synergyc
Autostart Synergy before logging in (KDM)
On the Client
Follow these steps to start the synergyc client when the KDM login screen launches. Add the following to the end of `/etc/kde3/kdm/Xsetup`:
/usr/bin/killall synergyc sleep 1 /usr/bin/synergyc <SERVER HOSTNAME>
Be sure to replace <SERVER HOSTNAME> with the host name or IP address of the computer running synergys. For the client file we must also edit the Xstartup script to kill our synergyc process running as root before the user Xsession scripts run. To do this add the following to the end of `/etc/kde3/kdm/Xstartup` and it should look like this:
#! /bin/sh # Xstartup - run as root before session starts PATH="$PATH:/usr/bin/X11" if [ -e /etc/nologin ]; then # always display the nologin message, if possible if [ -s /etc/nologin ] && which xmessage > /dev/null 2>&1; then xmessage -file /etc/nologin -geometry 640x480 fi if [ "$(id -u)" != "0" ] && \ ! grep -qs '^ignore-nologin' /etc/kde3/kdm/kdm.options; then exit 1 fi fi # synergyc process, running as root, ends here. This is the last script in the gdm login sequence before things start running as user. /usr/bin/killall synergyc sleep 1 if grep -qs '^use-sessreg' /etc/kde3/kdm/kdm.options && \ which sessreg > /dev/null 2>&1; then exec sessreg -a -l "$DISPLAY" -u /var/run/utmp \ -h "`echo $DISPLAY | cut -d: -f1`" "$USER" # NOTREACHED fi