Installation of VNC Server on CentOS 5.x

 I honestly thought I documented this already, but I searched the blog and was unable to locate it.

This covers installation and quick configuration of VNC on a server, in the event that Desktop access is needed on a remote server. In some cases, the CLI is not enough, and I’ve found this very useful.

On to the entry:

1. Login as root (or su)

2. Install required packages:
yum  -y install vnc-server

3. Secure the VNC server:
Set mypassword
cd ~/.vnc

the passwd folder should be listed

4. Configure the server:
nano /etc/sysconfig/vncservers
add to end of file:

VNCSERVERARGS [3] = “-geometry 1024×768”

5. Start the VNC service and configure service to autostart on boot:
service vncserver start
chkconfig vncserver on

6. Further configuration:
cd ~/.vnc
nano xstartup

add under the line “# Add the foll…”

(while true ; do xterm ; done) &

remove comments(#) from

#exec /etc/x11/xinit/xinitrc

7. Restart the vnc service
Service vncserver restart

8. Configure firewall to allow VNC server traffic
add 5903:tcp to exceptions list

9. Open VNC client from remote peer and connect to VNC Server:
server: 192.168.x.x:3
username myusername
password: mypassword (as set in Step 3)