Ubuntu 19.04: Connect to GNOME desktop environment via XRDP

1 Install XRDP

Install xrdp.

#!/bin/sh -e

# Xorg doesn‘t need TigerVNC.
sudo apt install -y xrdp

# The new_cursors draws black background around cursor.
sudo sed -e ‘s/^new_cursors=true/new_cursors=false/g‘ \
     -i /etc/xrdp/xrdp.ini
sudo systemctl restart xrdp

# Load Ubuntu config.
D=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
cat <<EOF > ~/.xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=${D}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF

# Avoid Authentication Required dialog.
cat <<EOF | \
  sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
[Netowrkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=yes
ResultInactive=no
ResultActive=yes
EOF
sudo systemctl restart polkit

2 Connect to GNOME desktop environment via XRDP

Use Xorg as a session type.Finish!

Ubuntu 19.04: Connect to GNOME desktop environment via XRDP

上一篇:OpenStack入门修炼之云主机创建(14)


下一篇:阿里巴巴繁星计划合作伙伴扶持方案(二期)活动说明