How to put an independent VNC server on Ubuntu 10.4
...and fix the drag and drop problem. The following guide worked for putting an independent VNC server running on Ubuntu 10.4. With independent I mean that is separate from the desktop session running on the computer that is connected to the physical monitor. Instead the below guide will give you an "always on" desktop session independent of what you see on the monitor. One advantage compared to desktop sharing is that you can adjust the screen resolution to fit comfortably in a window on the controlling computer. Another advantage is that you can run the vnc session as another user than who is currently using the computer, or as the same user but with a different desktop.
This guide intends to show you how to build a headless server with tightvnc, such that you can remotely access the server’s gui using any vnc client. I’m still working on it, so if you have any comments or questions, please feel free to let me know.
Ubuntu TightVNC Server - Dave Lachapelle
I followed the instructions to a "T" and it worked. Lachapelle recommends you remove the geometry option for Ubuntu 10.4, but it worked fine on my 10.4 computer.
After install i ran the script as "/etc/init.d/vncserver start" once. Xtightvncserver then prompted me to define passwords for accessing the new desktop, one password for full control, and one for viewing only.
You could extend the script to start several independent vnc sessions, to make the server work as a multiple desktop provider. That is how I use my CentOS 5 server (which is soon is going to be Ubuntified).
Update 2010-08-16, 2010-08-20, 2011-01-28
Currently drag and drop is broken in Gnome on Ubuntu 10.4 when you use tightvnc. Everything else seems to work though, and in most cases you can get around drag and drop by e.g. instead do a cut and paste. However for e.g. reordering playlists in Rhythmbox there is no workaround. Actually I spend a bit of time trying to figure out why the heck drag and drop did not work, when everything else worked. A bug in Gnome itself was not the first thing that sprang to mind. According to some sources on the Internet this bug affects all remote desktop sessions, but I have noticed that x11vnc works, although that is strictly for sharing an existing screen session.
See here for bug report and workaround for the drag and drop issue:
https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/587856
Basically, you need to slightly downgrade a couple of Gnome packages. I did this and drag and drop started working again. There is now what seems to be identification of the offending code upstream in the Gnome bug tracker, but it is not clear when a fix will find its way into Ubuntu.
The downgrade at the link above seems to be volatile. When you do other installs on your system, and possibly just straight updates, the downgraded Gnome packages will be replaced. I have currently done like this to fixate ("pin") the downgrade:
nano -w /etc/apt/preferences.d/pinGnomeForRemoteAccess
and in that file I put:
Package: libgtk2.0-0
Pin: version 2.20.0-0ubuntu4
Pin-Priority: 1001
Package: libgtk2.0-bin
Pin: version 2.20.0-0ubuntu4
Pin-Priority: 1001
Package: libgail18
Pin: version 2.20.0-0ubuntu4
Pin-Priority: 1001
Package: libgail-common
Pin: version 2.20.0-0ubuntu4
Pin-Priority: 1001
Package: gtk2-engines-pixbuf
Pin: version 2.20.0-0ubuntu4
Pin-Priority: 1001
2010-10-03: The pinning works! It's been in place now for several weeks, and drag and drop is still working.
2010-08-26: Added version keyword to pin file