Synergy, a very useful tool

Good companions! ..

In my first post I come to bring you a quick guide to a tool that I have used for a long time, this one is called Synergy. This program allows us to share our keyboard and mouse between several computers, moving from one monitor to another, just by dragging the mouse to the edge of the monitor.

Interesting aspects:

  • It is multiplatform! Yes gentlemen, you can cross it by your distro linuxera of taste, as well as the window and / or apple.
  • Being using several computers, we can use several programs distributed among our machines without saturating a single processor; In other words, it means that we do not need a "super computer" but can take advantage of several with fewer resources.
  • Convenience, just a keyboard and mouse above the desk.
  • Share the clipboard (copy and paste text) between computers.

As I told you above, despite being multiplatform, we are going to focus on how to use it in our penguin. In this guide I am going to focus on Debian and its derivatives (Ubuntu, Linux Mint, etc.) for practicality, but I doubt that it will be difficult to migrate it to other distros. We start?

1. Installation:

We can download the latest version from here., or a particular previous version, either beta or stable from this link.

Or, in the case of Debian and derivatives, from their respective repository:

# apt-get install synergy

The installation of the package must be done on all the machines that want to be involved in its use.

2. Configuration:

The first step in setting up synergistic is to open the port through which the connections will be made, for default this is port 24800. (in the case of already having it used or simply want to use another, it can be done quietly, only when executing it will have to specify the port to use); this is done with the command iptables:

# iptables -A INPUT -p tcp --dport 24800 -j ACCEPT

What does this?

-A = adds a rule to the chain.
-p = specifies the protocol.
--dport = indicates the destination port.
-j = determines the action.

2.2. Configuration File:

Now with the port open, we proceed to configure synergistic:

With your favorite text editor (in my case vi) we create the file synergy.conf en / etc /

# vi /etc/synergy.conf

Inside it we are going to write the following structure:

section: screens
hostnameDelServidor:
hostnameDelCliente1:
hostnameDelCliente2:
end
section: aliases
hostnameDelServidor:
ipDelServidor
hostnameDelCliente1:
ipDelCliente1
hostnameDelCliente2:
ipDelCliente2
end
section: links
hostnameDelServidor:
right = hostnameDelCliente2
left = hostnameDelCliente1
hostnameDelCliente1:
right = hostnameDelServidor
hostnameDelCliente2:
left = hostnameDelServidor
end

Note: the structure shown above is an example of a configuration with 3 machines. In which the one in the middle is the server (the one with the mouse and keyboard) and the other 2 as clients at its sides. Vary this configuration depending on the order and quantity of machines you like.

2.2.1. Configuration example:

// Order: Left —-> Right

// Hostname: PC1 (server) —-> PC2 (client)

// IP: 10.9.0.1 —-> 10.9.0.2

section: screens

PC1:

PC2:

end

section: aliases

PC1:

10.9.0.1

PC2:

10.9.0.2

end

section: links

PC1:

right = PC2

PC2:

left = PC1

end

2.2.2. Why use a text-based configuration?

Well, the first reason is that you don't really have a choice, unless you are using some version with a graphical interface. Second, it gives you more control. An interface cannot create advanced settings, such as a non-reciprocal connection. An example of a non-reciprocal connection is if you go to the right of monitor A you get to monitor B, but if you go then to the left of monitor B you get to monitor C instead of again to monitor A as it would be in a connection configuration reciprocal.

Other considerations:

  • These settings are easier to share with other people.
  • You can have more than one armed configuration, for different cases. (as it can be with a notebook that you use it in various places)

2.3. Starting Server / Client

2.3.1. Start Server

Once the relevant configurations have been made, it is as simple as putting the following in the console:

  $ synergys

Notice the 's' at the end, this refers to server.

If we want to see that it has loaded the configuration successfully and something more than info, when starting it, put the following:

  $ synergys -d DEBUG

2.3.2. Start Client

Once the server is started on the machine from which we will use our peripherals (keyboard and mouse), we start the rest of the machines involved as clients; putting in the terminal:

  $ synergyc -f IPdelServidor

Notice the 'c' in client, and where does it say ServerIP put the corresponding IP, if we focus on the example case (see 2.2.1) it would be:

  $ synergyc -f 10.9.0.1

–If we want to see its behavior and connections with the server:

  $ synergyc -f IPdelServidor -d DEBUG

–If we had specified a different port than the one used by default (24800), we put:

  $ synergyc -f IPdelServidor:puerto

3. Common problems (which I personally encountered):

3.1. Same Hostname:

If any of the computers you want to connect to through Synergy It has the same name as another, the program will not know when using them which one it refers to. To solve the problem, we must rename it (hostname) to one of them. We achieve this in the following way:

In terminal:

  hostname nombre_comp

, then we edit the file:

  / etc / hostname

and the file:

  / Etc / hosts

, making sure that 127.0.0.1 references that same computer:

127.0.0.1 localhost
127.0.1.1 comp_name

3.2. Error "Unknown screen name «XXX» «

If the configuration was loaded successfully and you get this error, then it means that the server monitor is not in the configuration. All monitors have to be listed in the configuration.

3.3. Error "Cannot open primary screen«

To solve this, a simple solution is to first start the client, and then the server.

3.4. Other problems

For other errors that arise, the following problems link on the page of Synergy.

I hope you liked my short tutorial. It is worth mentioning that although I show a basic configuration, it has many other features to add, such as limiting in which part of the monitor the transition is made to the other machine, among others. If you want to expand, you can googling for more advanced settings.

That's it, and I hope the contribution will be one more grain of sand for everyone.

From already thank you very much..

Scalibur ..


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   smudge said

    ohhhhhhhhh
    Wonderful, very, very useful.
    Thank you very much.

    1.    Scalibur said

      OT: I see you accepted my post! .. wii ..

      I'm glad it's useful to you .. 😀

  2.   hexborg said

    Very good. This the truth is that it seems very useful. I had heard of synergy, but had never tried it. Thanks a lot. 🙂

  3.   Miguel Martinez said

    Good information, well structured let's try it

  4.   Blaire pascal said

    Well Scalibur… Welcome to the family. My usr agent is bad just in case. Very useful.

    1.    Scalibur said

      Thanks! .. ..my usr agent is also wrong .. I use Linux Mint at the moment with OpenBox .. soon ArchLinux user ..

      And the idea of ​​the topic was to introduce something beneficial and of which there is no tutorial, or at least that I have seen .. xP

      Cheers!..

  5.   jorgemanjarrezlerma said

    Without words, what else can I say. An excellent topic as well as a very good alternative or option for those who have (I include myself) the need to use multiple PCs and manage them from a single one without much on the desktop.

  6.   charlie brown said

    This is more effective than using a KVM, as it allows you to copy & paste between the various computers ... VERY USEFUL the post, and that is the first.

  7.   Scalibur said

    Thank you very much for welcoming you!

    I hope this is the first of a few;) ..

    1.    KZKG ^ Gaara said

      Welcome member 😉
      I had already used this application in a project before, the only drawback or limitation that I saw is that I needed to control 15 computers simultaneously HAHA, too much LOL!

      Greetings and yes, let's hope it's the 1st of many more 😀

  8.   AlonsoSanti14 said

    Hello! very good post, I am going to test it with my desktop pc and my lap, the keyboard was screwed up… ..I only have one doubt, I know that the program must be installed in both components, but the configuration does not I am very clear, it is only done in the PC Server or in both do I have to put the configuration file?

  9.   AlonsoSanti14 said

    Hello! very good post, I am going to test it with my desktop pc and my lap, the keyboard was screwed up… ..I only have one doubt, I know that the program must be installed in both components, but the configuration does not I am very clear, it is only done in the PC Server or in both do I have to put the configuration file?

    1.    Scalibur said

      Hi! .. ..it is only necessary the config in the PC Server .. ..I hope it works for you ..

      1.    AlonsoSanti14 said

        ok thanks ... and of course it will be very useful ...

  10.   msx said

    I have not used it yet but if it has a good response speed it may be an interesting alternative to ssh / mosh when you have the machine next to it.

    1.    Scalibur said

      Hi! .. ..it is really very fast in terms of response .. ..there is practically no difference between one machine and another .. ..it is also possible to configure synergy by ssh .. ..Greetings! ..

      1.    msx said

        Done, I looked at the configuration files shipped with my distro, I looked at your guide and I already have the teams joined with Synergy on Avahi instead of IPs (which is what I use at home).
        Very clear your Scalibur explanation. By the power of Grayskull !!

        ...

        Ah no, that was another swordsman 😛
        http://www.youtube.com/watch?v=6GggY4TEYbk

        1.    Scalibur said

          Hahaha .. ..I am very glad that it has been of help to you ..

          PS: how interesting Avahi, I had never heard of him ..

          1.    msx said

            Avahi / mDNS is the best invention in the world after the chocolate Latte 🙂

            Actually Avahi is the opensource development of Bonjour, Apple's implementation of the Zeroconf protocol that includes mDNS as a pillar of the implementation since it is precisely the mDNS technology that allows multicast in the LAN network so that they can self-discover and then self-configure all connected equipment running this service.
            And here I want to make a brief parenthesis:
            Apple is always at the center of ruthless criticism from the rest of the industry and the reality is that most of those times it is totally unfair since both the mDNS protocol (multicast of equipment using Zeroconf), as CUPS and WebKit, to name three Hyper-known developments were developed by Apple in a totally open way and today we all benefit from them. Micro $ oft, on the other hand, not only has hateful business practices (such as Apple, it is true) but they are also mediocre who look at their navel and always live doing developments in secret and without publishing the specifications, such was the case CIFS , Microchot development based on the SMB (Server Message Block) and later reinvented in the F / LOSS field as SAMBA.
            In this particular case, Micro $ oft also has its implementation of Zeroconf but of course it is a proprietary implementation, totally closed and much more mediocre than Apple's, since if we look at what Microsoft networks generally are, we will see a multitude packets going back and forth everywhere, colliding with each other and saturating the network.
            What's more: if you have the opportunity to observe Microsoft networks, you will see how the load indicator LEDs of the network cards (generally green) blink continuously without stopping, like crazy, when the same implementation with Apple or F / LOSS solutions is a lot more efficient.
            Let's continue…

            The benefits of using Avahi / Zeroconf / Bonjour are multiple, including:
            1. You never need to remember the IP of each machine again since using Avahi you access them through their name + .local, for example:
            olivetti.local (my multipurpose home server)
            arrakis.local (the NAS)
            heybeavis.local (my lap)
            etc.
            Using Avahi / mDNS I access each of them with its hostname instead of the IP. In this way, in environments with _many_ machines, you get rid of the problem of the IPs of the computers changing since you will always access them by their hostname.
            In addition to this, computer networks are much more manageable for people who are not familiar with the OSI concept and to whom an IP address still seems almost arcane.
            In my particular case, they already know at home that if I am not there and the network is slow it is because I am torrenting like hell (all legal content, of course: D) so all they have to do is access the server through your name and pause downloads - using Transmission's cool web interface. But hey, they don't even know what Transmission is either xD
            2. Plug & Play: in an organization or large network when using Avahi you automatically make each device you want to share accessible, for example printers, scanners, servers, NAS, etc.
            3. Avahi / mDNS also allows you to designate fixed IPs to a specific hostname. For example: you can declare that all the machines that are in a certain network range are accessible through the hostnameX.local which greatly simplifies the interaction with these machines (service, installation of new software, etc.).
            4. It is really VERY COMFORTABLE to use Avahi / mDNS in the installation of networks to clients since in this way -for the above mentioned- we free ourselves from eternally remembering their infrastructure and configuration. Knowing how each team is called (for example, pinging the broadcast) we move like an eel through the network and finish our work much earlier without setbacks 🙂

            Anyway, Avahi / mDNS (Avahi / Zeroconf) offers many possibilities of which I use only a fraction but surely someone who has to manage a network with a multitude of teams with heterodox needs and mutable environments will find it very useful ^ _ ^

  11.   rodolfo said

    haha good post, the good thing is that when you work on several desks at the same time having a mouse for everyone really makes everything easier, I think it's great.
    By the way it would be strange if they will not accept the post is very good.

  12.   Hyuuga_Neji said

    Excellent article…. thanks and keep putting interesting things.

  13.   love it said

    Thanks for showing me this program.
    I believe the need just before seeing the Post.
    Greetings.

  14.   @Jlcmux said

    Testing and approved.

    It worked perfectly for me. Now I am the envy of many gamers.

    1.    RAW-Basic said

      Hey! .. ..I just noticed your answer .. ..sorry (what happens when you don't check your email) ..

      I'm glad it worked for you! .. 😀

      I still use it on a daily basis ... both for leisure and work .. 😉