一. 安裝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
1. xrdp在EPEL源中,先安裝EPEL源
#wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
2. 安裝及配置xrdp
yum install pixman libXfont
#yum install xrdp -y
# vim /etc/xrdp/xrdp.ini
bitmap_compression=yes
port=3389 #遠程桌面端口
crypt_level=high
channel_code=1
max_bpp=24
[xrdp1]
name=yujia #顯示在登陸窗口的Module欄,隨便起
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=5901#注意這里端口要與vncserver中的配置相對應,用戶root的vncserver連接端口為5901
3.啟動xrdp並加入開機自啟項
# /etc/init.d/xrdp start
#chkconfig xrdp on