Up until recently I’ve been accessing my laptop, running Intrepid, via the built-in Remote Desktop feature of GNOME over an SSH tunnel. While this works pretty well the mouse pointer feels like it is being dragged through Molasses and screen updates can be painfully slow; so I started to look for an alternative. When I used to run Windows XP I’d connect via Remote Desktop (RDP) which was quite useable. I wasn’t really worried if I got to use my actual desktop or use a virtual desktop just so long as it was fairly responsive. I tried various Howtos involving x11vnc, XRDP and finally FreeNX, but mostly these were out of date i.e. XRDP is now in the repositories. After a bit of hacking and some searching of PPAs I found that FreeNX worked the best.
What is FreeNX?
NX is an exciting new technology for remote display. It provides near local speed application responsiveness over high latency, low bandwidth links. The core libraries for NX are provided by NoMachine under the GPL. FreeNX is a GPL implementation of the NX Server and NX Client Components. NoMachine provides a free server but this is limited to 2 connections and is closed source, FreeNX provides an NX Server with unlimited connections under the GPL.
Configure PPA Repositories
Important The FreeNX PPA is now a signed PPA and so we need to install the correct GPG key in order to install any packages.
From a Terminal window type
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D018A4CE
Now we need to setup access to the FreeNX repository
gksudo gedit /etc/apt/sources.list.d/freenx.ppa.list
Copy the following to the new file (depending on your version of Ubuntu)
# Ubuntu FreeNX Repository for Karmic deb http://ppa.launchpad.net/freenx-team/ubuntu karmic main deb-src http://ppa.launchpad.net/freenx-team/ubuntu karmic main
# Ubuntu FreeNX Repository for Jaunty deb http://ppa.launchpad.net/freenx-team/ubuntu jaunty main deb-src http://ppa.launchpad.net/freenx-team/ubuntu jaunty main
# Ubuntu FreeNX Repository for Intrepid deb http://ppa.launchpad.net/freenx-team/ubuntu intrepid main deb-src http://ppa.launchpad.net/freenx-team/ubuntu intrepid main
Save and then run the following commands
sudo apt-get update sudo apt-get upgrade
Install FreeNX on your machine
First install the correct version of TCL for your version of Ubuntu.
sudo apt-get install tcl8.5
sudo apt-get install tcl8.4
Run the following command to install FreeNX and its components
sudo apt-get install openssh-server dbus-x11 libxcomp3 libxcompext3 nxlibs nxagent nxproxy freenx-server expect denyhosts xdialog
These files are being installed from a signed PPA so you shouldn’t be asked to confirm the installation of some libraries and the FreeNX binaries.
Install NX Client
Download and install the appropriate client from http://www.nomachine.com/download.php
NOTE: The Open Source Linux Client QTNX should have already been installed.
You should now be able to connect to you machine from any Windows, Mac or Linux client machine.
For best results set the desktop experience to MODEM.
NOTE: The LAN setting disables the compression and caching which means it uses A LOT of bandwidth. MODEM is a much better experience regardless of whether you’re on ADSL, Cable or LAN.
Troubleshooting the Windows Client
Most people, like me, will probably want to connect to their Linux box from Windows so on Windows the NX Client uses cygwin1.dll as part of the client, if you run another application which uses this dll and it is not the same version as the one used by the NX Client you will get a dialog box like this ..
Clicking either “Replace system DLL” or “Use system DLL” will let the client load however you then may receive an error that you “Cannot initialize the display service” like this (see http://www.nomachine.com/ar/view.php?ar_id=AR03E00449 for more details)
The best idea is to copy the NX Client’s cygwin1.dll into the other application’s directory to ensure it still runs; if it doesn’t then you’re going to have to run NX on it’s own.
I’ve tried to leave the settings alone as much as possible to ensure the simplicity of installing and configuring this service, however the default keys used are well known and should be changed using the following command
sudo dpkg-reconfigure freenx-server
Choose “Generate Custom Keys” then “SSH”
Copy the new key from /var/lib/nxserver/home/custom_keys/client.id_dsa.key into the client by clicking the “Configure …” button and then the “Key …” button. Copy the new custom key into this dialog and Save.
Please note that the FreeNX server won’t work if “PasswordAuthentication no” is set in /etc/ssh/sshd_config, this cost me a lot of time because I generally run my OpenSSH servers with this option and use Private Keys to access them securely. And remember to connect to the SSH server over the Internet port 22 will need to be forwarded to the machine hosting FreeNX. See http://portforward.com for information on how to setup port-forwarding on various routers.
5th Dec 2009 – Added Karmic details. Thank you again Alex Saavedra.
12th May 2009 – Added Jaunty details. Thank you Alex Saavedra.
25th Jan 2009 – Updated article to include information about Signed PPA support.