VNC via inetd

The VNC server (vncserver) can be started by an individual user, or it can be called by inetd.  The advantage of the latter is users don't have to remember to start it before they want to use it.  It also allows you, the admin, to provide a graphical interface for a Unix box to multiple mortal users by just giving them the vncviewer for their respective platform (and there are LOTS of different platforms for vncviewer).  The sessions are all separate from each other (although I think it can be setup so users all share the same session--not sure why you'd want to do this).  And it's free.  All features the commercial X-server vendors can't match.

Anyway, here are some notes on getting VNC to work.

Try running vncserver manually first and verify that you can connect to it.  If you can't do this, launching via inetd probably isn't going to work, either.  If you have trouble see the documentation page for VNC. Also of use is Andre Moreira's page on iXvnc. Ignore the parts about patching vnc since this feature is now part of the standard VNC (and has been for some time). Just jump down to the "Installing/Using" part.

The thing that mattered for me was making /tmp/.X11-unix world-writeable.  After that, vncserver worked by both methods.  Note that if the host is restarted, you'll probably need to reset the rights on that directory again, as /tmp is often cleared by reboots.  I had to do this once after just killing and restarting the X-server on the host.

Launching vncserver via inetd

Add this line to /etc/services:

vnc-800x600x16  5950/tcp                        # VNC server 

This tells the vncserver to run at 800x600 resolution with 16-bit color, and that the client should use display :50 when attaching.

Add this to /etc/inetd.conf:

vnc-800x600x16  stream tcp nowait nobody /usr/local/bin/Xvnc Xvnc -inetd -query gromit -once -geometry 800x600 -depth 16

(Note that the above should all be on one line.)

After adding the above, do a 'kill -1 ' to the PID of inetd. In the above line, 'gromit' is the name of the host that is running the VNC server. In the example on Andre's page he uses -broadcast instead. This caused a problem for me in that a SCO box on our network responded to this XDMCP request more quickly than did my Sun workstation, and so I was always getting a login screen for the SCO box, which I didn't want. So I specified the host instead. I believe there is a way to have it query all the hosts on the network that have an XDM running, such that you could then pick the host you wanted from a list, but I don't know the particulars on that.


Updated 01/25/02