一. 安装gnome图形化桌面

       #yum groupinstall -y "X Window System"

      #yum groupinstall -y "Desktop"

二.VNCSERVER

yum install tigervnc tigervnc-server

 #chkconfig vncserver on

vim /etc/sysconfig/vncservers

VNCSERVERS="1:root 2:chenjj"
VNCSERVERARGS[1]="-geometry 1920x1080 -depth 32 -nolisten tcp"
VNCSERVERARGS[2]="-geometry 1920x1080 -depth 32 -nolisten tcp"

/etc/init.d/vncserver start
说明:vncserver在调用的时候,会根据你的配置来启用server端的监听端口,
        端口默认是从5900开始,再加上你的桌面号。 比如你的桌面号为1,则vnc的连接端口号为5900+1=5901 比如你的桌面号为8888,则vnc的连接端口号为5900+8888=14788 

 

如果执行# service vncserver start有发现报以下错误

2:yanghg 
You will require a password to access your desktops.

getpassword error: Inappropriate ioctl for device
Password:3:yuy 
You will require a password to access your desktops.

getpassword error: Inappropriate ioctl for device
Password: [FAILED]

让用户设置密码(必须切换到配置文件中添加的用户名下,如yanghg)

# vncpasswd

 

修改 /root/.vnc/xstartup文件,把最后的 twm & 删掉 加上 gnome-session &。

/root/.vnc/xstartup

三。xrdp