觉得通过windows原生的远程桌面访问服务器,也很有意思。我这里设置成功了,就分享给大家。
服务器使用的是lightdm显示管理器。大家可以尝试其它的显示管理器。
1. 安装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

3、配置lightdm
这里需要配置XDMP服务器
root@localhost:~# vim /etc/lightdm/lightdm.conf
[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true
[XDMCPServer]
enabled=true

greeter-show-manual-login=true 指允许通过键入用户名和密码的方式来登录系统
XSMCPServer 字段指启动XDMCP服务器

4. 重启xrdp 和lightdm
root@localhost:~# /etc/init.d/xrdp rstart
root@localhost:~# /etc/init.d/lightdm rstart
5. 现在可以通过mstsc登录了便
图一:

图二:

图三: