My previous answer worked on the EC2 instance I was using, but when I tried it on another machine later, I had issues. (I'm still not sure what the difference was)
Anyway, I used the following instead. The different line is in .vnc/xstartup:
gnome-session --session=ubuntu-2d &
Instead of
gnome-session &
Here we go:
sudo apt-get install ubuntu-desktop tightvncserver
Edit ~/.vnc/xstartup to read:
#!/bin/sh
# Change "GNOME" to "KDE" for a KDE desktop, or "" for a generic desktop
MODE="GNOME"
#Uncommment this line if using Gnome and your keyboard mappings are incorrect.
#export XKL_XMODMAP_DISABLE=1
# Load X resources (if any)
if [ -e "$HOME/.Xresources" ]
then
xrdb "$HOME/.Xresources"
fi
# Try a GNOME session, or fall back to KDE
if [ "GNOME" = "$MODE" ]
then
if which gnome-session >/dev/null
then
echo starting gnome
gnome-session --session=ubuntu-2d&
else
MODE="KDE"
fi
fi
# Try a KDE session, or fall back to generic
if [ "KDE" = "$MODE" ]
then
if which startkde >/dev/null
then
startkde &
else
MODE=""
fi
fi
# Run a generic session
if [ -z "$MODE" ]
then
xsetroot -solid "#DAB082"
x-terminal-emulator -geometry "80x24+10+10" -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
fi
Run:
tightvncserver -nolisten tcp -localhost -geometry 1024x786 :1
Like I said, it worked great for me, but your mileage may vary.