I just recently installed and configure VNC server on my Red Hat Enterprise Linux. I had read alot of tutorials on the configuration of VNC server on a Red Hat Enterprise and based on the different tutorials I come up with more precise and short tutorial.
By default the vnc-server is already installed in most Linux distro but on some you have to install. For my case I just did the standard installation of REHL that's why I have to install vnc-server separately.
The first thing you need to do is to verify the vnc-server on your system. Below is the rpm command to verify if any vnc-server package was installed on the system.
rpm -q vnc-server
If no package found on your system, then you need to install it from RHEL cd packages.
On your home directory .vnc folder can be found and a file xstartup inside the .vnc folder. Edit the xstartup file and uncomment the below statements.
Issue the command ; vncserver :1
The above command will create an instance of vncserver and you can access that instance through a vnc client. ( e.g vncviewer 192.168.1.1:1 )
To verify if the vncserver is already issue the command :
netstart -tulpan | grep vnc
service vncserver status
To close the instance of vncserver use the below command :
vncserver -kill :1
If you want to run the vncserver on boot up. Edit the file /etc/sysconfig/vncservers and specified socket number with the username under VNCSERVERS.
VNCSERVERS = "1:myusername_1 2:myusername_2"
Then use the command below :
chkconfig --level 5 vncserver on
You might also like: