I have a process I worked out on Ubuntu 9 and 10 that gets VNC4 working with initd and GDM (Gnome Display Manager).  You know what I discovered though thanks to a poster on a forum?  They mentioned using FreeNX!  I tried it and LOVE LOVE LOVE it.  It works over ssh and you can resume your sessions.  Here’s how to install it, this is pretty much taken from the reference below but it’s worth posting here since I use my own site from time to time for notes and how to’s (or how I did’s :p).    Thanks k. de Jong for posting the how to and ayenack for the reference to the tutorial!

Reference:  https://help.ubuntu.com/community/FreeNX & http://ubuntuforums.org/archive/index.php/t-1490075.html

Installing the FreeNX server on Ubuntu Karmic (9.10) or Ubuntu Lucid (10.04) or Ubuntu Maverick Meerkat (10.10)

Open your terminal / command prompt

Applications->Accessories-> Terminal

Type in this command
sudo -i
sudo add-apt-repository ppa:freenx-team
* NOTE: If you do not have add-apt-repository installed add the following
sudo apt-get install python-software-properties
If you’re using Maverick, run (Ubuntu 10.10)
sudo sed -i ‘s/maverick/lucid/g’ /etc/apt/sources.list.d/freenx-team-ppa-maverick.list
apt-get update

At this point, the repository is added and apt is updated, then install the freenx package.

sudo apt-get install freenx

(NOTE: As of Aug. 16 2010 the above command doesn’t install a particular script which appears to be missing from the package. So after performing the above, download it from here.

Next, cd to the directory to where the script was downloaded (probably your downloads folder) and unpack it:

tar -xvf nxsetup.tar.gz
Then, copy the script to the proper directory: /usr/lib/nx/ with:
cp nxsetup /usr/lib/nx/nxsetup
Now use nxsetup to install necessary files and create the special user “nx”
/usr/lib/nx/nxsetup –install
Download the NoMachine Windows Client:  http://www.nomachine.com/download-package.php?Prod_Id=2581

Now you’re off to the races, follow the prompt and you’re good to go.  The communication goes over SSH so it’s encrypted and it is FAST FAST FAST once it connects.  For the initial connection you always see a “!M” screen, I’m guessing this is the NoMachine logo.

Again – all hail k. de Jong for the awesome post on how to install FreeNX on Ubuntu.  I also installed it on Ubuntu 10.10 but something about 10.10 was buggy (not with FreeNX but with Ubuntu).  On Ubuntu 10.10 you don’t need the extra script download step, it’s included.