Xvfb, CentOS7, gdm, and x11vnc

Yep, the title says it all. This is based on the previous post regarding RHEL6, and it is pure geekdom.

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.

CentOS makes it east to fetch the Xvfb package, which is not included in the DVD ISO image. You will need these two packages, from:


The release versions may vary, but you get the idea:


The /etc/gdm/custom.conf file is pretty much empty. Change is and make sure you have these options in it:

# GDM configuration storage







Then create the file /etc/systemd/system/Xvfb.service:

Description=X Virtual Frame Buffer Service

ExecStart=/usr/bin/Xvfb :1 -screen 0 1824x1004x24 -pixdepths 24 -query localhost


Ensure your changes take hold:

chmod +x /etc/systemd/system/Xvfb.service
systemctl enable Xvfb.service
systemctl start Xvfb.service

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.

Thank you to the author of this web page, for reference:


Comments are closed.