Ubuntu 18.04: Connect to KDE desktop environment via XRDP

Table of Contents

1 Install KDE desktop environment

Install KDE 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 “startkde” > ~/.xsession$ D=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop$ C=/etc/xdg/xdg-plasma:/etc/xdg$ C=${C}:/usr/share/kubuntu-default-settings/kf5-settings$ cat <<EOF > ~/.xsessionrcexport XDG_SESSION_DESKTOP=KDEexport XDG_DATA_DIRS=${D}export XDG_CONFIG_DIRS=${C}EOF

4 Avoid Authentication Required dialog

Authentication Required dialog will be displayed after XRDP connection is established.


For avoiding Authentication Required dialog, create the following pkla file which will success authentication. You can use unix-user:* as Identity and no as ResultAny which will fail authentication.

$ cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-NetworkManager.pkla[Netowrkmanager]Identity=unix-group:sudoAction=org.freedesktop.NetworkManager.network-controlResultAny=yesResultInactive=yesResultActive=yesEOF$ cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-packagekit.pkla[Netowrkmanager]Identity=unix-group:sudoAction=org.freedesktop.packagekit.system-sources-refreshResultAny=yesResultInactive=auth_adminResultActive=yesEOF$ sudo systemctl restart polkit

5 Connect to KDE desktop environment via XRDP

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


Android | Linux | SDL - Narrow Escape