1) From inside a gdm session:
System > Administration > Login Window
Remote Tab: Change “Style” from “Remote Login Disabled” to “Same as Local”
2) Install vnc4server and xinetd
apt-get install vnc4server xinetd
3) Set VNC passwd
sudo vncpasswd /root/.vncpasswd
4) Copy the following into /etc/xinetd.d/Xvnc (new file)
service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :2 -query localhost -geometry 1680x1050 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5902
}
5) Restart xinetd
sudo /etc/init.d/xinetd restart
6) To fix gnome-settings-daemon crash issue, we need to install xvnc >= 4.1.2, which as of this post is not in ubuntu repos. So, using rpmfind.net, get the latest vnc-libs, and vnc-server rpms (4.1.3 as of this post), and convert them to ubuntu friendly .deb packages with alien
wget ftp://rpmfind.net/linux/fedora/updates/9/x86_64.newkey/vnc-libs-4.1.3-1.fc9.x86_64.rpm
wget ftp://rpmfind.net/linux/fedora/updates/9/x86_64.newkey/vnc-server-4.1.3-1.fc9.x86_64.rpm
sudo apt-get install alien
sudo alien vnc-libs-4.1.3-1.fc9.x86_64.rpm
sudo alien vnc-server-4.1.3-1.fc9.x86_64.rpm
sudo dpkg -i vnc-libs_4.1.3-2_amd64.deb
sudo dpkg -i vnc-server_4.1.3-2_amd64.deb
These packages require libcrypto++7, and with a specific filename to boot, so:
sudo apt-get install libcrypto++7 libcrypto++-utils
sudo ln -snf /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.7
Note that this step creates all sorts of dependency issues since the 2 fedora packages overwrite the ubuntu ones without uninstalling vnc4server, oops. I’ll update this post one day to make this a bit cleaner to install. Just keep in mind when ubuntu finally updates its xvnc to do a bit of cleanup.
7) Finalle, restart xinetd again, and it should be working
sudo /etc/init.d/xinetd restart
References:
http://ubuntuforums.org/showthread.php?t=122402
http://www.motionstandingstill.com/setting-up-a-resumable-remote-login-to-ubuntu-with-vnc/2008-10-13/