Much of the information comes from this threads http://ubuntuforums.org/showthread.php?t=122402 and http://ubuntuforums.org/showthread.php?t=191564 and links in the threads. However the threads were started since 2006 and many pages long. After spending a few days digging through the information and links, I hope this information will save you time if you are setting up vncserver and gdm on 8.04.
The setup was done almost immediately after a fresh installation of 8.04 desktop on our office internal network.
To have vncserver setup with gdm on the host so that a remote vnc connection to it will be greeted with a gdm login screen for the user to login.
Clarification of terms used:
Host - refers to the PC you are trying to install vncserver on.
Remote - the PC that is going to connect to the host
1. Get required packages installed
On the host, run
Being a server guy, I prefer to ssh into the host and do all the work, so I also
sudo apt-get install vnc4server xinetd
This way I can directly test the vnc by using vncclient on my remote desktop to the host.
sudo apt-get install openssh-server
Of course if you have only a host PC, then you may also need a vncclient to test it.
2. Enable XDMCP
This is the part that is responsible for bring up the gdm login.
Uncomment this line
sudo vi /etc/gdm/gdm.conf
Enable xdmcp, look for [xdmcp] and change Enable to true.
3. Setup xinetd
sudo /etc/init.d/gdm restart
Create a new service file for xinetd
(vi is of course one of many editors you can use)
sudo vi /etc/xinetd.d/Xvnc
Paste the following into the file and save:
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
only_from = localhost
server = /usr/bin/Xvnc
server_args = -inetd -query localhost -geometry 1024x768 -depth 16 -cc 3 -once -SecurityTypes=none -extension XFIXES
port = 5901
4. Connect from remote
sudo /etc/init.d/xinetd restart
Because I added only_from = localhost in /etc/xinetd.d/Xvnc above, I will need to ssh tunnel and forward my remote port (see term clarification above, as this is actually my local PC that I working from) to the host (this is the 'remote' where vncserver is being installed). If you do not need this step (why not?), just remove the line.
I use putty on Windows so just go to
Connections >SSH >Tunnels
Source Port: 5901
Then establish a normal ssh connection to the host or use my existing ssh connection.
This link might be helpful for those using other clients https://help.ubuntu.com/community/VNCOverSSH
I use UltraVNC, so this is what I do:
VNC Server: localhost:5901
The vnc viewer should open up and a gdm login screen presented (with a Debian logo).
Enter your username and password. That's it.
Hopefully this do not generate 45+9 pages of discussion.
How to connect with an Ubuntu remote using vinagre (Ubuntu's default vnc client) through an ssh tunnel