1. 程式人生 > >Windows(xrdp+vnc)遠端連線Ubuntu系統

Windows(xrdp+vnc)遠端連線Ubuntu系統

一般情況下,很多伺服器會安裝ubuntu系統,而個人電腦常安裝windows系統。那麼,在windows系統中,如何通過遠端桌面連線軟體,遠端連線ubuntu系統呢?具體可以參考以下步驟:

(1)Ubuntu系統設定:安裝xrdp,vnc4server

安裝xrdp:sudo apt-get install xrdp

安裝vnc4server:sudo apt-get install vnc4server

(2)Ubuntu設定允許遠端連線和控制

具體參考下圖:

(3)設定xrdp

echo "gnome-session --session=gnome-classic" > ~/.xsession

該命令的作用是由於安裝了gnome桌面,ubuntu12.04中同時存在unity、GNOME多個桌面管理器,需要啟動的時候指定一個,不然即使遠端登入驗證成功以後,也只是背景。

(4)重啟 xrdp

通過執行命令重啟xrdp: sudo /etc/init.d/xrdp restart

(5)可能遇到的問題

A.連線錯誤

started connecting

connecting to 127.0.0.1 5900

tcp connected

security level is 0 (1 = none, 2 = standard)

error - problem connecting

執行以下命令,並重啟計算機:gsettings set org.gnome.Vino require-encryption false

B.解決問題A時,出現的新錯誤

在執行命令gsettings set org.gnome.Vino require-encryption false 之後,出現瞭如下的錯誤:

GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.

該錯誤的解決辦法如下:

在終端中輸入命令:export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/,然後執行gsettings set org.gnome.Vino require-encryption false,問題得到解決。

Tips:將命令export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/直接貼上到.bashrc檔案中,也可以解決問題B。但要記得貼上到.bashrc檔案中後,需要執行命令source .bashrc,使得export的命令生效。


參考自以下連線:

http://www.cnblogs.com/kehaimin/p/8622592.html