Ubuntu 20.04: Connect to GNOME desktop environment via XRDP

This article will describe connecting to GNOME desktop environment via XRDP.

1 Install XRDP

Install xrdp and set environment variables.

#!/bin/sh -e


sudo apt install -y xrdp

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

#echo "export PULSE_SERVER=your.client.ipaddr" >> ~/.xsessionrc

2 Connect to GNOME desktop environment via XRDP

Use Xorg as a session type. Windows Remote Desktop Connection is as the following.

0001_xrdp-gnome.png