Access the RackspaceCloud via NX

Sometimes you wish there was a Linux desktop image – but there isn’t. Typically all RackspaceCloud Linux images are server images without Gnome, KDE or even X11. It is still possible to install a desktop together with NX server (NX is a compelling alternative to using vnc) to get to the remote desktop on such a server image. The following lines list the necessary steps. There is a detailed instruction explaining how to get VNC running on RackspaceCloud / Ubuntu. I tried the following steps with RackspaceCloud and documented them here. Part of this information is taken from Eric Hammonds blog about EC2 and Ubuntu.

To start with, I found there is a problem with the locale setting  in Ubuntu 9.10 from Rackspace. You need to install the language pack first and then reconfigure the locale:

apt-get install language-pack-en-base
dpkg-reconfigure locales

You better test it with, e.g. with perl -v which shouldn’t complain about any locale settings anymore.

After that, create a new user “ubuntu” and set a password. The ubuntu user will be used to connect to the remote desktop once everything is set up correctly:

sudo useradd -d /home/ubuntu -m ubuntu
passwd ubuntu new_password

Installing NX involves three packages. It is no big deal to install manually, but there is a script available at Alestic written by Eric Hammand that I will use to install all of them. You can even run this script remotely with a little utility called runurl. So if you like, get the runurl utility and make it executable:

wget -qO/usr/bin/runurl
chmod 755 /usr/bin/runurl

Copy and paste the following URL to  your browser to see the details of the script you are going to execute. If you feel uncomfortable executing a script which is hosted at some remote site, then go and copy the script or simply cut and past the commands.

Then run the script by executing the following command:


The script will need a couple of minutes even on a fast machine. It download and installs the gnome desktop with the NX environment for the server.

At the end double check the file /etc/ssh/sshd_config contains the following two lines, if it doesn’t, correct it:

# Change to no to disable tunnelled clear text passwordsPasswordAuthentication yes
AllowUsers ubuntu

For Rackspace Ubuntu image, I also had to add the following entry to the hosts.allow file:

sudo echo 'SSHD: ALL' >> /etc/hosts.allow

After that, restart ssh with: sudo /etc/init.d/ssh restart

Then start and configure the Gnome desktop and X-server:

sudo /etc/init.d/gdm start
sudo dpkg-reconfigure xserver-xorg

To tell you the truth, depending on the Linux distribution, the way the distribution was built, and the cloud environment, it is easy to spend hours debugging connections problems with the UNIX desktop. The other solution, using ssh, be it from cygwin, or even better a real Linux with X-forwarding is typically easier and faster.


That’s it for the server site. On the client site get a NX client and enjoy.

Speak Your Mind