First install vncserver as user root
yum install vnc-server
I wanted VNC run as user “flashwebhost” as it is not recommended to use Desktop as user root, so i created a user
Now setup VNC Password for this user
su - flashwebhost vncserver
It ask password 2 times. You need this password to connect with VNC Viewer.
Now kill the VNC Server
vncserver -kill :1
:1 is display number. Mostly it will be 1.
Type exit to go back to root shell.
Now edit /etc/sysconfig/vncservers
Add following content to the file, save and exit.
VNCSERVERS="1:flashwebhost" VNCSERVERARGS="-geometry 1024x768"
Now start VNC Server
[[email protected] /]# service vncserver start Starting VNC server: 1:flashwebhost New 'sam.localhost:1 (flashwebhost)' desktop is sam.localhost:1 Starting applications specified in /home/flashwebhost/.vnc/xstartup Log file is /home/flashwebhost/.vnc/sam.localhost:1.log [ OK ] [[email protected] /]#
Now you will be able to connect to the server with SERVER-IP:1
To start VNC Server on boot
chkconfig vncserver on