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