使用Windows远程桌面(mstsc)通过RDP协议访问Ubuntu/Debian服务器

本本牛 2013-09-14

觉得通过Windows原生的远程桌面访问Ubuntu/Debian服务器,也很有意思。我这里设置成功了,就分享给大家。
服务器使用的是lightdm显示管理器。大家可以尝试其它的显示管理器。

1. Ubuntu/Debian下安装xrdp,同时把建议安装的软件也装上
root@localhost:~# apt-get  install xrdp
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following extra packages will be installed:
 vnc4server xbase-clients
Suggested packages:
 vnc-java
The following NEW packages will be installed:
 vnc4server xbase-clients xrdp
0 upgraded, 3 newly installed, 0 to remove and 72 not upgraded.
Need to get 2,146 kB/2,412 kB of archives.
After this operation, 7,086 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.163.com/ubuntu/ precise-updates/main xbase-clients all 1:7.6+12ubuntu2 [2,322 B]
Get:2 http://mirrors.163.com/ubuntu/ precise/universe vnc4server amd64 4.1.1+xorg4.3.0-37ubuntu4 [2,143 kB]
Fetched 2,146 kB in 10s (211 kB/s)                                     
Selecting previously unselected package xbase-clients.
(Reading database ... 93275 files and directories currently installed.)
Unpacking xbase-clients (from .../xbase-clients_1%3a7.6+12ubuntu2_all.deb) ...
Selecting previously unselected package vnc4server.
Unpacking vnc4server (from .../vnc4server_4.1.1+xorg4.3.0-37ubuntu4_amd64.deb) ...
Selecting previously unselected package xrdp.
Unpacking xrdp (from .../xrdp_0.5.0-2_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up xbase-clients (1:7.6+12ubuntu2) ...
Setting up vnc4server (4.1.1+xorg4.3.0-37ubuntu4) ...
update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode.
update-alternatives: using /usr/bin/Xvnc4 to provide /usr/bin/Xvnc (Xvnc) in auto mode.
update-alternatives: using /usr/bin/x0vnc4server to provide /usr/bin/x0vncserver (x0vncserver) in auto mode.
update-alternatives: using /usr/bin/vnc4passwd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode.
update-alternatives: using /usr/bin/vnc4config to provide /usr/bin/vncconfig (vncconfig) in auto mode.
Setting up xrdp (0.5.0-2) ...
* Starting Remote Desktop Protocol server                          [ OK ]

2、配置xrdp
目的是让xrdp传输远程服务的2D桌面,默认传输的是3D桌面,可能会有问题。
root@localhost:~# vim /etc/xrdp/startwm.sh
#!/bin/sh

if [ -r /etc/default/locale ]; then
 . /etc/default/locale
 export LANG LANGUAGE
fi
echo "gnome-session --session=ubuntu-2d" > .xsession  # 新添加的行
. /etc/X11/Xsession

相关推荐

林悠居 / 0评论 2020-05-19
84931231 / 0评论 2020-05-14