1. 安裝xrdp
zhou@desktop:~$ sudo apt-get install xrdp [sudo] password for zhou:
正在讀取軟體包列表... 完成
正在分析軟體包的相依樹狀結構
正在讀取狀態資訊... 完成
將會安裝下列額外的軟體包:
vnc4server xbase-clients
建議安裝的軟體包:
vnc-java
下列【新】軟體包將被安裝:
vnc4server xbase-clients xrdp
升級了 0 個軟體包,新安裝了 3 個軟體包,要卸載 0 個軟體包,有 0 個軟體包未被升級。
需要下載 2,412 kB 的軟體包。
解壓縮後會消耗掉 7,086 kB 的額外空間。
您希望繼續執行嗎。[Y/n]y
擷取:1 http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main xbase-clients all 1:7.6+12ubuntu2 [2,322 B]
擷取:2 http://cn.archive.ubuntu.com/ubuntu/ precise/universe vnc4server amd64 4.1.1+xorg4.3.0-37ubuntu4 [2,143 kB]
擷取:3 http://cn.archive.ubuntu.com/ubuntu/ precise/universe xrdp amd64 0.5.0-2 [267 kB]
下載 2,412 kB,耗時 4秒 (492 kB/s)
Selecting previously unselected package xbase-clients.
(正在讀取資料庫 ... 系統當前共安裝有 194579 個檔案和目錄。)
正在解壓縮 xbase-clients (從 .../xbase-clients_1%3a7.6+12ubuntu2_all.deb) ...
Selecting previously unselected package vnc4server.
正在解壓縮 vnc4server (從 .../vnc4server_4.1.1+xorg4.3.0-37ubuntu4_amd64.deb) ...
Selecting previously unselected package xrdp.
正在解壓縮 xrdp (從 .../xrdp_0.5.0-2_amd64.deb) ...
正在處理用於 man-db 的觸發器...
正在處理用於 ureadahead 的觸發器...
ureadahead will be reprofiled on next reboot
正在設定 xbase-clients (1:7.6+12ubuntu2) ...
正在設定 vnc4server (4.1.1+xorg4.3.0-37ubuntu4) ...
update-alternatives: 使用 /usr/bin/vnc4server 來提供 /usr/bin/vncserver (vncserver),於 自動模式 中。
update-alternatives: 使用 /usr/bin/Xvnc4 來提供 /usr/bin/Xvnc (Xvnc),於 自動模式 中。
update-alternatives: 使用 /usr/bin/x0vnc4server 來提供 /usr/bin/x0vncserver (x0vncserver),於 自動模式 中。
update-alternatives: 使用 /usr/bin/vnc4passwd 來提供 /usr/bin/vncpasswd (vncpasswd),於 自動模式 中。
update-alternatives: 使用 /usr/bin/vnc4config 來提供 /usr/bin/vncconfig (vncconfig),於 自動模式 中。
正在設定 xrdp (0.5.0-2) ...
* Generating xrdp RSA keys......
Generating 512 bit rsa key...
ssl_gen_key_xrdp1 ok
saving to /etc/xrdp/rsakeys.ini
[ OK ]
* Starting Remote Desktop Protocol server [ OK ]
2、配置xrdp
目的是讓xrdp傳輸遠程服務的2D案頭,預設傳輸的是3D案頭,可能會有問題。
zhou@desktop:~$ sudo 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伺服器
zhou@desktop:~$ sudo vim /etc/lightdm/lightdm.conf
[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
#以下為新加行
greeter-show-manual-login=true #指允許通過鍵入使用者名稱和密碼的方式來登入系統
[XDMCPServer] #欄位指啟動XDMCP伺服器
enabled=true
4. 重啟xrdp 和lightdm
zhou@desktop:~$ sudo /etc/init.d/xrdp rstart
Usage: /etc/init.d/xrdp {start|stop|restart|force-reload|status}
zhou@desktop:~$ sudo /etc/init.d/xrdp restart
* Stopping RDP Session manager [ OK ]
* Starting Remote Desktop Protocol server [ OK ]
zhou@desktop:~$ /etc/init.d/lightdm restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service lightdm restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop lightdm ; start lightdm. The restart(8) utility is also available.
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.119" (uid=1000 pid=4742 comm="stop lightdm ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
5. 現在可以通過windows的mstsc遠程登入
原文地址:http://wangxiaoyu.blog.51cto.com/922065/1294098