Desktop sharing options for Ubuntu 12.04 with Unity

I would like to be able to access my office Ubuntu 12.04 machine from home, from a Mac Mini with Mac OSX. I have a VPN and I am able to access my office machine over SSH, so connectivity is not a problem. I browsed other questions, and it seems that there are several options:

  • VNC
  • XRDP
  • FreeNX (haven't heard this one before)
  • Are there any other?

I have been using Remote Desktop on Windows before, and I actually like it. Not sure how well is XRDP implemented. I also used VNC several years back, and I didn't like its performance back then - not sure if things have changed since then.

As I said above, the machine I want to access is running Ubuntu 12.04, with Unity. And I am using Unity by choice - I really like it and would like to continue using it :) The client computer is running Mac OSX (Snow Leopard).

Based on your previous experience what is the best setup for this environment?


I have tested out various VNC server implementations including:

  • TightVNC
  • RealVNC
  • FreeNX
  • X11VNC

Overall I'd say that the easiest to setup, good performance on dual-display configurations, cross-platform support for many clients, and most reliable for me has been X11VNC.

FreeNX was very difficult to setup, though it was subjectively not that much better or faster than other solutions I tried, so the payoff wasn't as great as I'd hoped. FreeNX only worked with *nix clients at the time I tried it, and I needed a cross-platform solution. It could be that I mis-configured it and speed wasn't optimized for my connection somehow, although I'm not sure.

TightVNC and RealVNC worked reasonably well for me in the past. TightVNC was great on low-speed connections, while RealVNC was great for a slight bit of extra security (b/c it supported longer passwords w/custom block encryption algorithm). However, I had encountered some issues that made me decide to go with X11VNC. The first was that I had problems when rebooting a remote system, starting the VNC server again on it, and trying to connect to it when no X session was already running (just the gdm login screen). I was able to fix this with x11vnc and this helpful script. The second problem that made me switch was that cross-platform and compatibility with many different VNC clients was also important to me. Most modern internet connections are fast enough to give a reasonably good experience when connecting to a remote system, even over SSH tunneling. You can experiment with passing some options when starting the x11vnc server to make things snappier if you wish. Some that I've found are in my script.

To set up X11VNC:

  1. Run sudo apt-get update
  2. Run sudo apt-get install x11vnc
  3. Run x11vnc -storepasswd and input a password to protect your VNC from unauthorized access Note 1
  4. Run x11vnc -usepw to start the server Note 2
  5. Connect to the server with your favorite VNC client Note 3

Note 1: The password is by default stored in a file: ~/.vnc/passwd. This file is encrypted by a symmetric key and a special block encryption algorithm. However the key and the algorithm are known, so it is possible to decrypt it (Please only decrypt your own password and don't be evil). Treat this file as a key to your computer, and protect it with file permissions of 0600 (chmod 0600 ~/.vnc/passwd).

Note 2: You may add additional command line arguments if you wish, but this one is required for password protection

Note 3: Use SSH tunneling for security. VNC passwords are sent in plaintext over the network. To do this you'll create a tunnel with ssh -L 5900:localhost:5900 and then connect your VNC client to localhost on port 5900. If you don't care about security, or trust everyone on your network then connect your VNC client to the host directly.

For example:

  • Given hostname foo.local => connect to foo.local on port 5900
  • Given IP 192.168.1.123 => connect to 192.168.1.123 on port 5900