This article describes how to set up a very lightweight VNC service under CentOS/Red Hat.
Intro
In Red Hat Enterprise Linux (and derivates, I use CentOS) you can run a VNC service to allow graphical connections to a linux system. I was looking for a very lightweight VNC service (no fancy desktop with all the bells and whistles, just something that lets me do some stuff that requires an X session and run an Xterm – such as installing Oracle or running Swingbench, without using another host with an X client). In other words, a typical service for virtual machines that run as servers (such as database servers, web servers, etc).
CentOS standard method
I tried the standard documented way to do this in CentOS: CentOS Virtual Network Computing using the standard tigervnc-server method, but found a few issues with the way they set it up:
- For every user requiring VNC services, you need to customize the configuration
- If one user deletes or corrupts his VNC password file, the whole service stops working (fix via normal SSH login but requires skilled user)
- If a user messes up his xstartup file he is locked out (fix via normal SSH login but requires skilled user)
- Users need 2 passwords: for their (own) VNC service, and the usual one for Linux
- Their X window and VNC processes are always running and thus eating resources even if not used
- If their X session hangs (i.e. window manager killed, or simple logout) it’s hard or even impossible to clean up and restart (see section 4 in the mentioned article: Recovery from a logout) without resetting the whole VNC service
- Every user requires a separate, unique TCP port
All by all, nice and easy for a small test server with a few users, but no good for larger environments. The good thing is that the desktops are persistent, i.e. you may disconnect and reconnect later and the VNC session will be as you left it. And you can install lighter desktop environments (twm or openmotif) instead of the huge and heavy Gnome desktop.
But I was looking for something better.