Ubuntu 的遠程訪問——XRDP

  1.  需求
  2. 備選方案
  3. 軟件
  4. 配置
  5. 存在的問題及解決方案

===============================================================html

1. 需求linux

    經過遠程桌面訪問Ubuntu 14.04。ubuntu

    由於服務器須要託管在機房,不能直接接觸到,但又時常須要遠程訪問一些圖形化的程序,因此產生了遠程桌面的需求。vim

2. 備選方案windows

    實現該需求仍是有不少方案可選的,可是各有優劣:bash

  • SSH X11 Tunneling
  • VNC
  • XRDP

    從個人使用體驗來講:服務器

        X11 Tunneling 是最簡單的方案,可是侷限比較大,常常出現沒法轉發的狀況。體驗不是很好。session

        VNC 能夠經過TurboVNC、vnc4server、tightvncserver等實現,可是在分辨率上我的感受體驗不是很好,而且須要vncviewer來訪問(其實軟件很小)app

        XRDP XRDP經過rdp協議進行通信,能夠方便的使用windows自帶的mstsc進行訪問,並且功能比較強大,自動縮放的體驗比較棒。ui

    所以,我選擇XRDP做爲遠程桌面訪問的方案。

3. 軟件

  • xrdp
  • xfce4 
sudo apt-get install xrdp xfce4 xfce4-goodies gnome-icon-theme-full

    xrdp:

        來源:

                來自 universe,因此軟件源中要加上universe(我順手把multiverse也加上了,由於xfce4在multiverse中)。

sudo apt-add-repository universe
sudo apt-add-repository multiverse
sudo apt-get update

        依賴:

(依賴vnc-server哎,我以前還把vnc刪了,安裝完xrdp發現又出現了,才意識到依賴vnc-server)

xrdp
  Depends: libc6
  Depends: libpam0g
  Depends: libssl1.0.0
  Depends: libx11-6
  Depends: libxfixes3
  Depends: adduser
 |Recommends: vnc4server
 |Recommends: tightvncserver
  Recommends: <vnc-server>
    tightvncserver
    vnc4server

      xfce4:

           之因此選擇xfce4不用原有桌面環境的緣由,下文另表。

           來源:

               來自 multiverse。

           依賴:

xfce4
  Depends: xfwm4
  Depends: xfconf
  Depends: xfce4-settings
  Depends: xfce4-panel
  Depends: xfdesktop4
  Depends: thunar
  Depends: gtk2-engines-xfce
  Depends: xfce4-session
  Depends: xfce4-appfinder
  Depends: xfce4-mixer
  Depends: orage
  Depends: libxfce4ui-utils
  Suggests: xfce4-goodies
  Suggests: xfce4-power-manager
  Suggests: gtk3-engines-xfce
  Recommends: xorg
  Recommends: desktop-base
  Recommends: thunar-volman
  Recommends: tango-icon-theme
  Recommends: xfce4-notifyd

4. 配置

    系統:

        修改默認的桌面。(2選一)

        1. 修改遠程登陸桌面

echo "xfce4-session" >~/.xsession

        2. 修改系統默認桌面   

sudo mkdir -p /etc/lightdm/lightdm.conf.d
sudo vim /etc/lightdm/lightdm.conf.d/xfce.conf

#add this line
[SeatDefaults]
user-session=xfce

echo "xfce4-session" >~/.xsession

    修改完畢,須要重啓使LightDM的配置修改生效。

    其餘一些桌面設置能夠參考wiki:  https://wiki.ubuntu.com/LightDM

    xfce4:

          上條的桌面設置。

    xrdp:

        xrdp的修改,爲了可以重連,我只作了登陸上的修改。

sudo vim /etc/xrdp/xrdp.ini

……
[xrdp1]
name=sesman-vnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
……

         其中要有幾點要點:

            1) [xrdp Number] 應該按照順序寫

            2)ask選項相似於默認值,可是能夠在登陸框中修改

            3) port的值 -1 表明尋找現階段可用的端口

            4)咱們要重連須要使用上次會話使用的端口才行(我還沒解決固定端口問題)

                        沒有找到比較簡單的解決方法,貼幾個做爲參考

                        http://c-nergy.be/blog/?p=4168

5. 存在的問題及解決方案

  1.  xfce遠程登陸不能補全的問題
    • 此問題是由於Tab被快捷鍵佔用,去除便可。"Settings->Window Manager", in the "Keyboard" tab, clear the binding of "Switch wndow for same application -> Tab"
  2.  vnc下不能輸入s或者m的問題
    • 此問題據有的網友說是由於軟件衝突,可是他提供的衝突軟件並不存在於個人系統版本中,因此緣由未知,用不到,也未解決。

Refs:

http://www.cfei.net/archives/1324

https://devtalk.nvidia.com/default/topic/785551/embedded-systems/my-jetson-focused-linux-tips-and-tricks/

https://devtalk.nvidia.com/default/topic/828974/jetson-tk1/-howto-install-virtualgl-and-turbovnc-to-jetson-tk1/

http://www.programgo.com/article/81302225765/

http://cuiqingcai.com/402.html

https://community.spiceworks.com/how_to/92663-configure-users-to-connect-to-ubuntu-14-04-from-a-windows-machine-using-remote-desktop

https://linux.die.net/man/5/xrdp.ini

相關文章
相關標籤/搜索