Launching the VNC server via xinetd on Linux boxes

This document is about getting the Xvnc server to launch via xinetd. xinetd is the standard network service daemon on Red Hat-derived Linux systems, and it replaced the inetd system found on older Unix systems. If you need instructions on getting Xvnc to run under inetd, see my companion document VNC via inetd.

While Red Hat 3 and 4 come with the VNC server, the installation sets it up such that you have to specify specific user IDs underwhich the vncserver binary runs and users get just a barebones X display; that is, it's not tied into the display manager, such as GDM, and XDMCP, and not what you probably want. Rather, you want the users to be able to run the vncviewer on their desktop and get the GDM login screen when the connect to the server, similar to that which is shown on the console. To do this follow these steps:

  1. Download and install the vnc-ltsp-config-4.0-3.noarch.rpm file. It contains some additional scripts needed to make Xvnc and xinetd work together. This version is from the K12LTSP project and based on Fedora Core 5. It works fine with RHEL 4.3 and should work with most other versions, as it's just a few simple scripts.
  2. Enable vncts in xinetd:
    chkconfig vncts on
  3. Assuming the box is running gdm (Gnome Display Manager), which RH uses by default, modify either the /etc/X11/gdm/gdm.conf file (on older Fedora Core systems) or /etc/gdm/custom.conf file (on newer versions such as RHEL 5 or CentOS 5 systems), changing

    Enable=false
    to
    Enable=true
    in the [xdmcp] section. On CentOS 5, you have to add the Enable=true statement.
  4. Add the following to /etc/X11/xdm/Xaccess:
    localhost

    This file doesn't exist by default on CentOS 5, in which case you can ignore this step.
  5. Restart gdm by running
    gdm-restart

  6. Restart xinetd by running
    service xinetd restart
You should now be able to point vncviewer at the host and get a windowed graphical login prompt. Look at the bottom of /etc/services to see the list of different resolutions and color levels you can choose by pointing vncviewer at different ports.