[Linux] Ubuntu 18.04 XRDP Remote Desktop Config & Problem

[Linux] Ubuntu 18.04 XRDP Remote Desktop Config & Problem

OS Version: 18.04.1 LTS

XRDP Verison: 0.9.5-2

Ubuntu在18版重回了Gnome桌面環境的懷抱,雖然18版在利用Windows做遠端登入桌面時可以不用在切換成xface、LXDE或Mate了,但是仍是有一些小Bug需要處理,在這邊記錄安裝和排除的過程

另外新版的xrdp不允許Local和Remote同時登入,Local登入的時候,同帳號Remote就無法登入,反過來說也一樣,而且一定要進行正常登出程序,另一個才有辦法登入,這部分還在研究要怎麼修改就是了

Install

apt install xrdp gnome-tweak-tool gnome-shell-extension-*
systemctl enable xrdp

Fix

做完上面的步驟後就可以登入了,但是在登入的時候會遇到一些問題,像是...

(1) 輸入完帳號密碼,卻無法轉入桌面模式,變成一片青綠色卡住不動,最後跳出connection error

(2) 沒有Gnome的基本圖示

(3) 跳出授權的警告視窗

以下說明各問題的排除方式:

無法轉入登入畫面的問題 ( Xwrapper Problem )

vim /etc/X11/Xwrapper.config
allowed_users=console

# Change to
allowed_users=anybody

# You will need to logout or restart PC, after you change the service's config.

U18XRDP_007

沒有Gnome桌面圖示的排除方法 ( No Gnome Icon or Env Problem )

U18XRDP_003

U18XRDP_004

解決方法是在想要登入的帳號家目錄底下增加,.xsessionrc的檔案

vim ~/.xsessionrc
xrDp=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=${xrDp}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg

U18XRDP_005

U18XRDP_006

跳出授權警告視窗 ( Authentication Required to Create Managed Color Device Problem )

跳出的授權警告是因為Polkit的管制造成的,Polkit是用來管理桌面應用程式權限的服務,目前在xrdp的部分當跳出授權視窗後你輸入了2次密碼( Enter Password twice ),遠端桌面連線會直接斷線( connection off ),所以不在意的人可以直接選擇取消( Cancel),反而就能登入桌面環境

U18XRDP_001

U18XRDP_002

而會在意這個問題的人,請依照下面的方法把Polkit對xrdp的權限關閉,就可以讓授權警告視窗不會在跳出來了,

vim /etc/polkit-1/localauthority/50-local.d/45-allow.colord.pkla

[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactice=no
ResultActive=yes

以上

Reference

遠桌連線 Linux 桌面

ubuntu 18.04 xrdp 无法启动和登录的解决办法

解决XRDP远程登录ubuntu系统无法恢复上次回话的问题

Ubuntu 18.04: Connect to GNOME desktop environment via XRDP

Authentication is required to create a color managed device in XRDP

Connect to Ubuntu 16.04 / 17.10 / 18.04 Desktop via Remote Desktop Connection (RDP) with Xrdp

Ubuntu 18.04 – Install xRDP the easy way (Scripted Installation)

xRDP – How to Fix Theme issues in Ubuntu 18.04 remote session

xRDP – How to Fix the Infamous system crash popups in Ubuntu 18.04 (and previous versions)

xRDP – The Infamous “Authentication Required to Create Managed Color Device” Explained

Polkit (简体中文)

Add a Comment