First, you need to add the freenx-team PPA for Ubuntu 12.04 GNU/Linux.
sudo add-apt-repository ppa:freenx-team
Next, update your sources list, then install the FreeNX server software
sudo apt-get update
sudo apt-get install freenx
Next, as noted in the community documentation for installing FreeNX - download the missing nxsetup script, untar it, then copy it to /usr/lib/nx (the command below is one entire line that runs 3 commands and ends with /usr/lib/nx):
wget https://bugs.launchpad.net/freenx-server/+bug/576359/+attachment/1378450/+files/nxsetup.tar.gz && tar xvf nxsetup.tar.gz && sudo cp nxsetup /usr/lib/nx
Now, run the nxserver setup script.
sudo /usr/lib/nx/nxsetup --install --setup-nomachine-key
At this point, you have FreeNX server installed, but now you'll want to configure the FreeNX server to configure clients to use ubuntu-2d session:
echo -e "\n#Use unity 2d for client sessions\nCOMMAND_START_GNOME='gnome-session --session=ubuntu-2d'"|sudo tee -a /etc/nxserver/node.conf
Next, restart the FreeNX server to ensure it takes in the .conf file:
sudo /etc/init.d/freenx-server restart
That's it for the FreeNX server, now let's move on to the client. First, install the 'qtnx' package on Ubuntu 12.04 so we can have a client application to access the FreeNX server. You'll have to launch the Ubuntu Software Center, then click 'Edit > Software Sources' from the top menu. Then place a check by "Community-maintained free and open-source software (universe).
Now, run the commands to update your sources and install the qtnx application from the terminal (CTRL + ALT + t):
sudo apt-get update
sudo apt-get install qtnx
from the Dash start the 'qtnx' application. Enter the username/password for a user on the server, set the speed to LAN, then click configure. On the configuration dialog, set a name for the prfile, the hostname(or IP address) for the FreeNX server machine, the client resolution (I used 1024x768), network speed (LAN), and set the platform type to GNOME
EDIT: to connect to VPS machine you can ssh or use putty easily.
After you’ve opened Putty, fill out the Hostname or IP Address field with your Hostname or IP Address. The default port for this is 22.
Click on the Open button to open a new command line window.
When the command line window appears, you will be asked for the SSH username at the login as prompt. Type it in and then press Enter on your keyboard.
In the command line window, you will also be asked for the SSH password at the login as prompt. Type it in and then press Enter on your keyboard.
You are now successfully logged into your VPS server using SSH access.