Xvfb, RHEL6, gdm, and x11vnc

Yep, the title says it all. Pure geekdom. As the Gnome Display Manager ages, options that were available are no longer, taking away some awfully useful technology.

Sometimes it is nice to have not only one X display start at boot, but two! My choice is to have the first display tied to hardware, and the second be software based. The latter can be accomplished with VNC, but it has been my preference to use the X Virtual Frame Buffer package (Xvfb), and let x11vnc do the translation to the VNC protocol.

With Redhat 6, options in the /etc/gdm/custom.conf file are now simply ignored without any notice. It is (or was) pretty frustrating to get a system to boot with a VNC session that ran the Gnome Display Manager (gdm). That, combined with the fact the Xvfb no longer ships as a standard part of the operating system (only available through a subscription channel) makes it difficult at best to continue such functionality that was present in release 5.

Assuming you can get an official Xvfb package from Redhat, here is how to make the magic happen. The /etc/gdm/custom.conf file is pretty much empty. Make sure you have these options in it:

# GDM configuration storage

[daemon]

[security]
AllowRemoteRoot=true
DisallowTCP=false

[xdmcp]
Enable=true
MaxSessions=30

[greeter]

[chooser]

[debug]

Then create the file, /etc/init/xvfb.conf:

# Do not edit this file directly. If you want to change the behaviour,
# please create a file xvfb.override and put your changes there.

start on stopped rc RUNLEVEL=5

stop on starting rc RUNLEVEL=[!5]

console output
respawn
respawn limit 10 120
exec /usr/bin/Xvfb :1 -ac -screen 0 1440x900x24 -pixdepths 24 -query localhost

Ensure your changes take hold:

# initctl reload-configuration
# initctl list

To hook it to VNC, add your service in /etc/services:

vncserver       5901/tcp

Add your /etc/xinetd.d/vncserver file:

service vncserver
{
        disable = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /path/to/x11vnc/binary
        server_args     = -inetd -rfbport 5901 -forever -shared -q -skip_lockkeys -o /dev/null -display :1 -buttonmap 12345-123:Prior::Next: -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:
        log_on_failure  += USERID
}

And restart xinetd. Voila! You now have GDM running, available via VNC. Cheers.

Comments are closed.