First install the Tigervnc-server:
Yum Install Tigervnc-server
After installation, set vi/etc/sysconfig/vncservers.
[[Email protected]001~]#Cat/etc/sysconfig/Vncservers # The Vncservers variable is a list of Display:user pairs.## uncomment the lines below to start a VNC serve R on display:2# as my'MyUserName'(adjust this to your own). You'll also# need to set a VNC password; Run'Mans VNCPASSWD'To see how# to DoThat . # # Do not RUN the this SERVICEifyour local area network is# untrusted!for a secure-to-a-to-a using VNC, see this url:# https://access.redhat.com/knowledge/solutions/7027# Use"-nolisten TCP"To prevent X connections to your VNC server via tcp.# use"-localhost"To prevent remote VNC clients connecting except when# doing so through a secure tunnel. See the"-via"Optioninchthe# 'MansVncviewer'manual page.vncservers="1:root"vncserverargs[2]="-geometry 800x600-nolisten tcp-localhost"vncservers="2:work"vncserverargs[2]="-geometry 1024x768-nolisten tcp-localhost"
To start the Vncserver server:
[[Email protected]001 ~]# Service vncserver start
Switch to work user, set vncpasswd
The open VNC port can be seen on the server:
Install Viewvnc on Windows, enter the IP address and port number to connect:
Enter Password:
You can see the successful connection on the CentOS 6.5 desktop:
Win7 Remote Desktop Connection CentOS 6.5