Installing VNC on Centos 5.3

Install VNC server package upon server setup, then run in include GNOME desktop environment:
# yum -y groupinstall “GNOME Desktop Environment”
# yum remove esc
remove smart card module (not needed)
Add a user(s)
# vi /etc/sysconfig/vncservers
VNCSERVERS=”0:root”
VNCSERVERARGS[0]=”-geometry 1024×768 -depth 16″
In this case we need to use port 5900+0 so port 5900.
 
Setting a password
# vncpasswd
Password: P4ss—
Verify: P4ss—
 
# service vncserver start
# chkconfig vncserver on //set VNCserver to start at bootup
 
Open firewall ports to allow VNC services:
# vi /etc/sysconfig/iptables
# Open VNC for USER1
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5800 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 6000 -j ACCEPT
# Open VNC for USER2
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5801 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 6001 -j ACCEPT
# service iptables restart
 
How to reconnect to VNC
# ps -ef | grep vnc
Look for process ID next to the username, then
# kill [process ID]
# vncserver :1
 
Connect at port 5901
 
——————————–
 
I find a method could reuse the lowest number via “vncserver”
cd /tmp
 
ll -al you will find some files like these: .X0-lock …. .X7-lock
 
rm -r .X*
 
vncserver
 
reuse :1 not :8
 
——————-
 
To disable gnome-panel and background
# killall gnome-panel
To enable gnome-panel
# service start gnome-panel
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *