How to install a VNC server on CentOS 6

Install required packages

yum groupinstall Desktop 
yum install tigervnc-server xorg-x11-fonts-Type1
chkconfig vncserver on
/etc/init.d/vncserver start

Add VNC user

useradd dcorneschi
su - dcorneschi
vncpassword

Edit configuration files

vi /etc/sysconfig/vncservers

VNCSERVERS="1:dcorneschi"
VNCSERVERARGS[1]="-geometry 1024x600"

/home/dcorneschi/.vnc/xstartup

#twm &
exec gnome-session &

Commands

  • Run a VNC session: vncserver
  • Kill the VNC session: vncserver -kill :1
  • Log file location: /home/dcorneschi/.vnc/c6vm02dev:1.log

Links