I added a user for accessing vncsessions edited /etc/sysconfig/
vncservers
and in xstartup file of the user in his .vnc directory
did changes as mentioned here http://wiki.centos.org/HowTos/VNC-Server
[vncusers@testmachine root]$ vncviewer localhost:1
VNC Viewer Free Edition 4.1.2 for X - built Mar 24 2009 19:52:30
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
vncviewer: unable to open display ""
I did tried ssh -X <remote host> and run xclock
it did not worked it gave following error
Error: Can't open display: