Friday 26 December 2014

XVnc does not present GDM Greeter (Login) after openvpn installed - XDMCP

I thought I'd write this up so that it can help anyone else who hits the same issue.

I have a Xvnc set up on my Debian Wheezy (7) with xinetd serving on ports 5900 and up.

All was working fine until I installed openvpn and set up a tunnel to my other site.

After that, I could connect using vnc but Xvnc would only show the default X background - Xvnc was not connecting to GDM using XDMCP to present the login and complete the Display Manager startup.

After a bit of strace'ing of the gdm3 process - the server for XDMCP UDP port 177 - it became obvious that gdm was having trouble resolving the IP Addresses. It all started working when I added the tunnel's local address in the /etc/hosts.

Here's the important parts of the etc/gdm3/daemon.conf:
[security]
DisallowTCP=false

[xdmcp]
Enable=true
DisplaysPerHost=3

Here's the /etc/xinetd
service Xvnc
{
        type = UNLISTED
        disable = no
        socket_type = stream
        protocol = tcp
        wait = no
        user = nobody
        server = /usr/bin/Xvnc
        server_args = -inetd -desktop Acer -query localhost -depth 24 -cc 3 -once -SecurityTypes=none -x XFIXES -geometry 1280x1024 -geometry 1440x900 -geometry 1024x768 -geometry 2560x1440
        port = 5901
}

And as my host has the following Interfaces:
eth0: 192.168.15.10
lo: 127.0.0.1
tun0: 192.168.88.6

Here is my /etc/hosts:
127.0.0.1       localhost
127.0.1.1       acer.cregganna.com      acer
192.168.15.10   acer.cregganna.com      acer
192.168.88.6    acer.cregganna.com      acer