linux远程桌面连接xdrp+vncserver

1.安装需要的包openssl-devel,pam-devel,autoconf,automake,libtool,libssl-dev,libX11-devel,libxfixes-dev,libXfixes-devel

[root@gdgz-htjf-kvc01-1 CentOS]# mount /dev/cdrom /mnt

[root@gdgz-htjf-kvc01-1 CentOS]# cd /mnt/CentOS

[root@gdgz-htjf-kvc01-1 CentOS]# ls -lh pam*
-rw-r--r-- 4 abc  abc  977K Mar 13  2010 pam-0.99.6.2-6.el5_4.1.i386.rpm
-rw-r--r-- 4 abc  abc  976K Mar 13  2010 pam-0.99.6.2-6.el5_4.1.x86_64.rpm
-rw-rw-r-- 4 abc  abc   19K Nov 19  2007 pam_ccreds-3-5.i386.rpm
-rw-rw-r-- 4 abc  abc   20K Nov 19  2007 pam_ccreds-3-5.x86_64.rpm
-rw-r--r-- 4 abc  abc  188K Mar 13  2010 pam-devel-0.99.6.2-6.el5_4.1.i386.rpm
-rw-r--r-- 4 abc  abc  188K Mar 13  2010 pam-devel-0.99.6.2-6.el5_4.1.x86_64.rpm
-rw-r--r-- 4 root root 136K Apr 27  2010 pam_krb5-2.2.14-15.i386.rpm
-rw-r--r-- 4 root root 136K Apr 27  2010 pam_krb5-2.2.14-15.x86_64.rpm
-rw-rw-r-- 4 abc  abc   34K Nov 19  2007 pam_passwdqc-1.0.2-1.2.2.i386.rpm
-rw-rw-r-- 4 abc  abc   34K Nov 19  2007 pam_passwdqc-1.0.2-1.2.2.x86_64.rpm
-rw-rw-r-- 4 abc  abc  279K Nov 19  2007 pam_pkcs11-0.5.3-23.i386.rpm
-rw-rw-r-- 4 abc  abc  286K Nov 19  2007 pam_pkcs11-0.5.3-23.x86_64.rpm
-rw-rw-r-- 4 abc  abc   35K Nov 19  2007 pam_smb-1.1.7-7.2.1.i386.rpm
-rw-rw-r-- 4 abc  abc   36K Nov 19  2007 pam_smb-1.1.7-7.2.1.x86_64.rpm
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh pam-devel-0.99.6.2-6.el5_4.1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:pam-devel              ########################################### [100%]

[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh openssl-devel-0.9.8e-12.el5_4.6.x86_64.rpm
error: Failed dependencies:
        krb5-devel is needed by openssl-devel-0.9.8e-12.el5_4.6.x86_64
        zlib-devel is needed by openssl-devel-0.9.8e-12.el5_4.6.x86_64

[root@gdgz-htjf-kvc01-1 CentOS]# ls -lh zlib-devel*
-rw-rw-r-- 4 abc abc 101K Nov 19  2007 zlib-devel-1.2.3-3.i386.rpm
-rw-rw-r-- 4 abc abc 102K Nov 19  2007 zlib-devel-1.2.3-3.x86_64.rpm
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm
Preparing...                ########################################### [100%]
   1:zlib-devel             ########################################### [100%]

[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh krb5-devel*
error: Failed dependencies:
        e2fsprogs-devel is needed by krb5-devel-1.6.1-36.el5_4.1.i386
        keyutils-libs-devel is needed by krb5-devel-1.6.1-36.el5_4.1.i386
        libselinux-devel is needed by krb5-devel-1.6.1-36.el5_4.1.i386
        e2fsprogs-devel is needed by krb5-devel-1.6.1-36.el5_4.1.x86_64
        keyutils-libs-devel is needed by krb5-devel-1.6.1-36.el5_4.1.x86_64
        libselinux-devel is needed by krb5-devel-1.6.1-36.el5_4.1.x86_64

[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm
Preparing...                ########################################### [100%]
        package zlib-devel-1.2.3-3.x86_64 is already installed

[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh e2fsprogs-devel*
Preparing...                ########################################### [100%]
   1:e2fsprogs-devel        ########################################### [ 50%]
   2:e2fsprogs-devel        ########################################### [100%]
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh keyutils-libs-devel*
Preparing...                ########################################### [100%]
   1:keyutils-libs-devel    ########################################### [ 50%]
   2:keyutils-libs-devel    ########################################### [100%]

[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh libselinux-devel*
error: Failed dependencies:
        libsepol-devel >= 1.15.2-1 is needed by libselinux-devel-1.33.4-5.5.el5.i386
        libsepol-devel >= 1.15.2-1 is needed by libselinux-devel-1.33.4-5.5.el5.x86_64
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh libselinux-devel-1.33.4-5.5.el5.x86_64*
error: Failed dependencies:
        libsepol-devel >= 1.15.2-1 is needed by libselinux-devel-1.33.4-5.5.el5.x86_64
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh libsepol-devel*
Preparing...                ########################################### [100%]
   1:libsepol-devel         ########################################### [ 50%]
   2:libsepol-devel         ########################################### [100%]
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh libselinux-devel-1.33.4-5.5.el5.x86_64*
Preparing...                ########################################### [100%]
   1:libselinux-devel       ########################################### [100%]
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh e2fsprogs-devel*
Preparing...                ########################################### [100%]
        package e2fsprogs-devel-1.39-23.el5.x86_64 is already installed
        package e2fsprogs-devel-1.39-23.el5.i386 is already installed
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh keyutils-libs-devel*
Preparing...                ########################################### [100%]
        package keyutils-libs-devel-1.2-1.el5.x86_64 is already installed
        package keyutils-libs-devel-1.2-1.el5.i386 is already installed
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh libselinux-devel*
Preparing...                ########################################### [100%]
        package libselinux-devel-1.33.4-5.5.el5.x86_64 is already installed
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh krb5-devel*
Preparing...                ########################################### [100%]
   1:krb5-devel             ########################################### [ 50%]
   2:krb5-devel             ########################################### [100%]
[root@gdgz-htjf-kvc01-1 CentOS]#   其他同样方法安装即可,不一一阐述。

 

2.安装 xrdp,vnc-server

xrdp-v0.6.0使用源码编译

下载地址 http://www.xrdp.org/
#tar -zxf xrdp-v0.6.0.tar.gz
#mv xrdp-v0.6.0/ /usr/lib64/xrdp-v0.6.0/
#cd /usr/lib64/xrdp-v0.6.0/

#./bootstrap
#./configure
#make
#make install

[root@gdgz-htjf-kvc01-1 CentOS]# ls -lh vnc*
-rw-rw-r-- 4 abc abc 159K Mar 25  2009 vnc-4.1.2-14.el5_3.1.x86_64.rpm
-rw-rw-r-- 4 abc abc 2.1M Mar 25  2009 vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
[root@gdgz-htjf-kvc01-1 CentOS]# rpm -ivh vnc-server-4.1.2-14.el5_3.1.x86_64.rpm

3.配置xrdp,编辑/etc/xrdp下面的xrdp.ini和sesman.ini

#xrdp.ini 关键在globals的配置

[globals]
bitmap_cache=yes           #位图缓存
bitmap_compression=yes     #位图压缩
port=3389                  #监听端口
crypt_level=low            #加密程度(low为40位,high为128位,medium为双40位)
channel_code=1

#sesman.ini
[Globals]
ListenAddress=127.0.0.1       #监听ip地址(默认即可)
ListenPort=3350               #监听端口(默认即可)
EnableUserWindowManager=1     #1为开启,可让用户自定义自己的启动脚本
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh

[Security]
AllowRootLogin=1              #允许root登陆
MaxLoginRetry=4               #最大重试次数
TerminalServerUsers=tsusers   #允许连接的用户组(如果不存在则默认全部用户允许连接)
TerminalServerAdmins=tsadmins #允许连接的超级用户(如果不存在则默认全部用户允许连接)

[Sessions]
MaxSessions=10                 #最大会话数
KillDisconnected=0             #是否立即关闭断开的连接(如果为1,则断开连接后会自动注销)
IdleTimeLimit=0                #空闲会话时间限制(0为没有限制)
DisconnectedTimeLimit=0        #断开连接的存活时间(0为没有限制)

[Logging]
LogFile=./sesman.log           #登陆日志文件
LogLevel=DEBUG                 #登陆日志记录等级(级别分别为,core,error,warn,info,debug)
EnableSyslog=0                 #是否开启日志
SyslogLevel=DEBUG              #系统日志记录等级

4.操作系统设置

允许远程桌面连接

 

 这里主要注意,Ask you for confirmation 要去掉,否则每次连接的时候需要在终端进行确认

会出现以下画面,vnc viwer则显示黑屏

 

 

FAQ:

1.(gnome-session:14575): Gtk-WARNING **: cannot open display:

vi startwm.sh  加入

DISPLAY=:0
export DISPLAY

2.运行xrdp_contorl.sh时 ,./sesman: error while loading shared libraries: libscp.so: cannot open shared object file: No such file or directory

把 xrdp下面的libscp.so文件夹拷贝到系统/lib64目录下。

3.win7、sp3出现 “由于协议错误,会话将被中断。请重新连接到远程计算机”

由于安装的xrdp的版本低于xrdp-0.5.0以下,会出现此问题。最初安装了0.4.2,出现了这个错误。

安装了xrpd-v0.6.0后可以。

4.tightVNC xrdp 键盘keymap问题

http://bugs.gentoo.org/show_bug.cgi?id=190865

Bill Skellenger 2009-07-27 00:54:44 UTC
I disabled the keyboard and a11y-keyboard plugins in the configuration editor,
then restarted my VNC session.   This fixed the issue for me.   There is a
discussion here:
 
https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/320393
https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/199245

 

其他:

xrdp启动  /etc/xrdp/xrdp.sh start

xrdp停止  /etc/xrdp/xrdp.sh stop

参看日志: tail -f /var/log/xrdp-sesman.log

设置开机启动

#cp /etc/xrdp/xrdp.sh /etc/rc.d/init.d

#chkconfig --add xrdp.sh

#chkconfig --level 2345 xrdp.sh on

你可能感兴趣的:(linux,远程桌面,xrdp+vncserver)