VNC Server on Debian 3.1 (Sarge)


Recently Deloy asked me for help setting up VNC on some Fedora servers his students are using. While I’ve never used Fedora, the setup I use in Debian Sarge should work on any sensible Linux distribution (and probably any good *nix machine). This setup will allow multiple users to login concurrently.

The packages I use:

  • tightvncserver 1.2.9 (plain old vncserver works, but tightvncserver has better compression)
  • vnc-common 3.3.7
  • x11vnc 0.7
  • netkit-inetd 0.10 (any sort of inetd/xinetd implementation should work)

1. Append to /etc/services:

custom-vnc 5951/tcp

Note: There’s nothing magical about port 5951, specify whatever port you want.)

2. Append to /etc/inetd.conf:

custom-vnc stream tcp nowait nobody.tty /usr/bin/Xvnc Xvnc -inetd -query localhost -once -geometry 800x600 -depth 16

Note: Tweak the geometry & depth settings depending on the bandwidth you have available. Don’t be afraid to specify non-traditional geometries like 800×1000 to get the best fit for your desktop.

3. Restart inetd. In Debian I usually use the bizarre “invoke-rc.d inetd restart” command although a good “/etc/init.d/inetd restart” accomplishes the same task. For some reason I’ve always thought the invoke-rc.d method was preferred, but I have no clue where I got that idea from.

4. Connect remotely. On another computer open up your favorite VNC viewer and point it to the hostname and port (port not Display number) of the server you just setup VNC server on.

You should see your default X Windows Display Manager login screen (probably gdm for Gnome or kdm for KDE). You can now login and use that computer remotely. Simply logout when you’re finished.

Caveat: As far as I know you cannot share a single VNC session among multiple viewers, but that feature of VNC doesn’t make much sense in this context.

Tip: While the Tight encoding supported by many VNC clients and servers offers JPEG compression which is great for low-bandwidth connections. However, Tight encoding takes a lot more processing time than other encodings and the compression is lossy, so stick to the simpler encodings for LAN connections.

Warning: The VNC protocol is not secure. Please use a VPN or secure tunneling protocol like SSH when using VNC.