Ubuntu 18.04: Connect to MATE desktop environment via XRDP

This article will describe installing MATE desktop environment and XRDP, and connecting to MATE desktop environment via XRDP.

1 Install MATE desktop environment

Install MATE desktop environment with this.

2 Install XRDP

Install XRDP.

$ sudo apt install -y xrdp
$ sudo sed -e 's/^new_cursors=true/new_cursors=false/g' \
-i /etc/xrdp/xrdp.ini $ sudo systemctl enable xrdp $ sudo systemctl restart xrdp

3 Create ~/.xsession and ~/.xsessionrc

Create .xsession and .xsessionrc in home directory of user to be connected.

$ echo "mate-session" > ~/.xsession
$ XDG_DATA_DIRS=/usr/share/mate:/usr/share/mate:/usr/local/share
$ XDG_DATA_DIRS=${XDG_DATA_DIRS}:/usr/share:/var/lib/snapd/desktop
$ cat <<EOF > ~/.xsessionrc
export XDG_SESSION_DESKTOP=mate
export XDG_DATA_DIRS=${XDG_DATA_DIRS}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-mate:/etc/xdg
EOF

4 Connect to MATE desktop environment via XRDP

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

0001_xrdp-mate.png