一. 安裝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