Synergy Client Mac OS X Leopard

I recently got a new 24 inch iMac and needed a way to share my keyboard and mouse between Mac OS X 10.5 (Leopard) and Windows XP. Synergy does exactly that. Setting up a Synergy server under XP was simple, but the Mac client was a little more tricky.

Apparently there is a bug in Synergy 1.3.1 with OS X 10.5. When you try to start Synergy (client or server) as a daemon under OS X 10.5 it crashes. Below is a workaround which starts the Synergy client at boot in the foreground (-f) through launchd. Put this file in /Library/LaunchAgents/net.sourceforge.synergy2.plist (needs root privileges):


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>net.sourceforge.synergy2</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/synergyc</string>
        <string>-f</string>
        <string>-1</string>
        <string>--name</string>
        <string>imaczomg</string>
        <string>--debug</string>
        <string>WARNING</string>
        <string>deathstar</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Here is what the argument string will look like:
/usr/local/bin/synergyc -f -1 –name imaczomg –debug WARNING deathstar

/usr/local/bin/synergyc - the path to your synergy client binary
-f - run in the foregorund
-1 - do not restart on error (launchd will do this for us)
imaczomg - the name (or IP) of your mac client
–debug WARNING - won’t log every time the mouse moves off the screen
deathstar - the name (or IP) of your server

If you are running a Synergy server on OS X 10.5 please look here.

16 Responses to “Synergy Client Mac OS X Leopard”

  1. Chad Moore Says:

    Steve,
    Love your workaround. I upgraded to Leopard and now Synergy won’t work. I tried your file above but am a newbie at this type of file and it (Synergy client) won’t work when I restarted the Mac. (Server is on an XP machine). I have a temporary workaround by typing the argument string directly into a Terminal Window but unlike the previous version I now have to keep Terminal open or Synergy quits. Can I email you my .plist file and have you tell me where I messed it up? I’d love to get the client to launch automatically! Thanks for your work on this.
    Chad

  2. steve Says:

    Hi Chad,

    My plist is here:
    http://stevehorbachuk.com/plist/

    Your console (Utilities->Console) is very helpful in debugging as well.

  3. Ben Says:

    Hi Steve,

    Thanks for taking the time to make this–I never really liked that the Synergy site only gives instructions for using a StartupItem rather than launchd.

    I recently upgraded my Mac mini to Leopard (a fresh install). I had previously used Tiger on the mini as a client to a Windows XP Synergy server without many problems (beyond setting it up). However, in Leopard, I cannot get synergyc to start before a user logs in. (That is, I have to use something else to log into the machine. After logging in, everything works just fine.) After spending a while on the net, I found that I might need to change from putting the plist in LaunchAgents to putting it in LaunchDaemons. See here:

    http://www.makemacwork.com/startup-processes-with-launchd.htm

    This makes synergyc start at boot (the process is owned by root), but it doesn’t work correctly. After inspecting the Console, I see that “Untrusted apps are not allowed to connect to or launch Window Server before login.”

    Any ideas? For the time being, I’m just keeping an extra keyboard and mouse out just to log in.

    Thanks again,

    – Ben

  4. Cody Robbins Says:

    Thanks, this gets Synergy working for me on Leopard again!

    Since no one explicitly states it anywhere, you can manually have launchd start Synergy after you set this all up, if you don’t want to restart your computer:

    launchctl load /Library/LaunchAgents/net.sourceforge.synergy2

    You might also want to delete the login hook you previously had, if you were, like me, starting Synergy in Tiger using the second method listed on the autostarting page on the Synergy website:

    # Make sure your login hook is still the one in place.
    defaults read com.apple.loginwindow LoginHook
    # Delete it if so.
    sudo mv /Library/LoginWindow/LoginHook ~/.Trash
    defaults delete com.apple.loginwindow LoginHook

  5. steve Says:

    @Ben

    The solution above uses /Library/LaunchAgents.

    Check your permissions. Try this:
    sudo chown -R root:wheel /usr/local/synergy

    Where /usr/local/synergy is the directory containing the synergy binaries and config file.

    @Cody

    Thanks for the tip on launchctl. Hopefully this will help some people that haven’t read the launchd docs.

  6. Jon Says:

    Hi,

    One thing I’m not clear about is whether the little synergy startup script should be in LaunchDaemons or LaunchAgents? I think I read elsewhere that it needs to be run as root (?), in which case I think the Daemons folder is the correct location, but are there any security implications to doing this????

    Cheers, Jon

  7. Neal Mann Says:

    I figured out a way to get Synergy to work in Leopard at the login window as well as after successful login:

    http://sourceforge.net/forum/message.php?msg_id=5021604

    Thanks for the tips which pointed me in the right direction.

    Steve, have you ever tried to set up an auto-negotiated SSH session at boot time in Leopard? I would love for this to happen so that Synergy could be encrypted from the get-go. It’s trivial to make Synergy tunnel through SSH manually, but I’ve had the darndest time getting SSH to work with launchd. It appears that ssh-agent or ssh-add isn’t passing the passphrase for the client’s public key off correctly. Any ideas?

  8. Dave Says:

    Hi, thanks for the sample plist file. I had the same issue Ben had above with the “…not allowed to connect to or launch Window Server before login”. Adding the following lines to the plist file fixes it for me:

    LoginWindow
    Aqua

    Cheers,
    Dave

  9. Dave Says:

    OK, hopefully the tags will render properly this time…

    <array>
    <string>LoginWindow</string>
    <string>Aqua</string>
    </array>

  10. Dave Says:

    Once more for good measure, this time with the whole thing…

    <key>LimitLoadToSessionType</key>
    <array>
    <string>LoginWindow</string>
    <string>Aqua</string>
    </array>

  11. Mike Says:

    Thanks the plist LaunchAgents solution worked for me with XP/MacMIni…

  12. Hannes Says:

    Thank for making this valuable information available to the public.

  13. Neil Kandalgaonkar Says:

    Thanks — this was very helpful.

  14. Mark Says:

    Nicer MacOS friends installer/panel

    http://sourceforge.net/projects/synergykm/

  15. Антон Павлович Says:

    Да, действительно. Так бывает. Давайте обсудим этот вопрос. Здесь или в PM….

    I recently got a new 24 inch iMac and needed a way to share my keyboard and mouse between Mac OS X 10.5 (Leopard) and Windows XP. Synergy does exactly that…..

  16. Sturtevant Says:

    All the info is great in this blog, thank you. Please continue in this way I think is a very interesting niche.

Leave a Reply