Configure Linux VNC Server
While most of the Linux servers I administer and run have no GUI installed sometimes it can be handy to administer a remote Linux workstation or server via a GUI, this is also an exam requirement for the the Red Hat Certified Systems Administration exam so let’s see how a VNC server is installed and configured under Linux.
Install VNC Server
The first step of setting up a VNC Server under Linux is of course that of installing the required packages, for RHEL and its rebuilt systems the process is pretty straightforward and quick and can be achieved with the following command :
yum install tigervnc-server
Once yum has done installing the required package, which has very few dependencies, you can proceed to the configuration of the various VNC Sessions.
Configure VNC Server
Once VNC server has been installed you need to configure the various sessions and the ports on which the VNC server will listen, the syntax of the needed command, in its simplest form, is as follows :
vncserver
When launched without any argument the command will configure the required configuration files under the user’s home directory and will create a listener on the default port for VNC which is 5901, this is good as long as you need to configure only one VNC server but how to proceed in case you need to configure multiple VNC sessions for different users? The command to accomplish this is as follows :
vncserver :2
After asking you to input a session password, the above command will configure a listening VNC Server for the current user on port 5902 as specified by the argument :2 which can really be any other valid number relative to the 590X port.
VNC Server change password
As anticipated the vncserver command will configure a VNC session for any user and will require you to input a password to protect the session, if later on you need to change the password chosen you can easily do that with the following command :
vncpasswd
Again the system will require you to input the password twice and will configure it for the session.
To test the configuration of the VNC server just configured you can use the default viewer that ships with Linux to open a connection like in the following picture :
That’s all for the VNC Server configuration under Linux, I hope you did find the post useful and will look forward your comments or questions in case you have any.
Cheers Lethe.

