Here take centos 6.5 as an example

Install gnome desktop environment

yum groupinstall "x window system" "desktop"

centos install xfce desktop environment,Optional

yum groupinstall xfce

Install tigervnc

yum install tigervnc-server tigervnc

Set up remote login to gnome desktop configuration,Add the following two lines to the end:


vncserverargs [1]="-geometry 1024x768 -alwaysshared -depth 24"

Modify the remote desktop display configuration file:modify to the following and save

vim /root/.vnc/xstartup

#uncomment the following two lines for normal desktop:
unset session_manager
[-r $home/.xresources]&&xrdb $home/.xresources
xsetroot -solid grey
vncconfig -iconic&
xterm -geometry 80x24 + 10 + 10 -ls -title "$vncdesktop desktop" &
gnome-session&#set starting gnome desktop
#startkde & #kde desktop
#twm & #text interface

New service,Perform multiple services to build multiple services,The order is:1:2:3, and each time you start, you will be prompted to set a password.


Close specific vncserver commands

vncserver -kill:1
vncserver -kill:2


chkconfig vncserver on

Firewall settings

After you start the vnc service, you can use the netstat -tunlp command to view the ports used by the vnc service.It can be found that there are 5801, 5901, 6001 and so on. Use the following command to open these ports:

Restart the firewall:

#netstat --tunlp
proto recv-q send-q local address foreign address state pid/program name
tcp 0 0* listen 2092/xvnc
tcp 0 0* listen 1459/rpcbind
tcp 0 0* listen 2092/xvnc
tcp 0 0* listen 1711/sshd
tcp 0 0* listen 1557/cupsd
-a rh-firewall-l-input -p tcp -m tcp --dport 5801 -j accept
-a rh-firewall-l-input -p tcp -m tcp --dport 5901 -j accept
-a rh-firewall-l-input -p tcp -m tcp --dport 6001 -j accept
#/etc/init.d/iptables restart

Install the windows client:

Launch trigervnc viewer

Enter the server ip:01, for example:

After connecting, enter the password set every time you start vncserver to connect to the centos desktop.

  • Previous Detailed usage of Yii's Srbac plugin
  • Next Build ASPNET Core environment under cloud server