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