I got better results on Oneiric Ocelot using the steps below derived from Anand Soni's answer (which I up-voted and hope you will too). Anand's is probably better for Precise onward.
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update
sudo -E apt-get install -y ubuntu-desktop
wget http://64.34.173.142/download/3.5.0/Linux/nxclient_3.5.0-7_i386.deb
wget http://64.34.173.142/download/3.5.0/Linux/nxnode_3.5.0-9_i386.deb
wget http://64.34.173.142/download/3.5.0/Linux/FE/nxserver_3.5.0-11_i386.deb
sudo dpkg -i nxclient_3.5.0-7_i386.deb
sudo dpkg -i nxnode_3.5.0-9_i386.deb
sudo dpkg -i nxserver_3.5.0-11_i386.deb
sudo /usr/NX/bin/nxserver --status
sudo sed -i 's/PasswordAuthentication\ no/PasswordAuthentication\ yes/g' /etc/ssh/sshd_config
sudo service ssh restart
sudo passwd ubuntu
Note there are i386 and amd64 versions of NX Free Edition downloads from NoMachine. Check their download pages for the right links for the wget commands and unpacking steps in the middle section above.