Linux remote desktop with xrdp and Kubuntu

Linux remote desktop with xrdp and Kubuntu
Page content

Remote desktop on linux is sometimes a bit of a pain. With xdrp there is a solution, that works pretty well, although it utilises a Microsoft Protocol and sometimes does not work out of the box - the configuration is tricky. Here is how to set up with Kubuntu.


The Remote Desktop Protocol (RDP) is a proprietary protocol to connect a user interface over network. On Windows systems, this protocol can be used out of the box while on Linux you have to install an extra service. The most popular one is xrdp.

Enable xrdp on Kubuntu >= 19.04

Instead of going too much into detail, here is a list of commands to execute (also usable as script). After these you should have your xrdp up and running on Kubuntu:

# install xrdp service
sudo apt install -y xrdp

## fix black cursor bug
sudo sed -e 's/^new_cursors=true/new_cursors=false/g' -i /etc/xrdp/xrdp.ini

# enable and start xrdp service
sudo systemctl enable xrdp
sudo systemctl restart xrdp

# Set session to plasma
echo "/usr/bin/startplasma-x11" > ~/.xsession

# store variables for .xsessionrc
export D=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop
export C=/etc/xdg/xdg-plasma:/etc/xdg
export C=${C}:/usr/share/kubuntu-default-settings/kf5-settings

cat <<EOF > ~/.xsessionrc
export XDG_DATA_DIRS=${D}

# fix "authentication required" bug
cat <<EOF | \
  sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-NetworkManager.pkla

cat <<EOF | \
  sudo tee /etc/polkit-1/localauthority/50-local.d/xrdp-packagekit.pkla
sudo systemctl restart polkit

Client tools and testing

The above commands should work, but you need a client tool to perform the real check. Fortunately, there is software for the most common operating systems:

  • Windows
    • mstsc - default microsoft tool, included in Windows
    • mRemoteNG - more sophisticated with connection management, but 3rd party
  • MacOS
  • Linux
    • Remmina - via package manager or instructions on website
  • Web-App / Alternatives


If it does not work, you might change the default session manager:

sudo update-alternatives --config x-session-manager

Maybe the values for some variables are not the same. To compare these on plasma, login and run:


If the values are not the same to the ones used in the script, try to fix them. Otherwise, you should take a look at the logs:


What else should I know?

While most of the time, this solution works like a charm, there are some things you should know about.


  • Remote unlocking of encrypted drives is not possible without extra tools (like ssh)
  • Remote login and local login are not possible at the same time (often, after a remote login local logins don’t work anymore)
    • There are workarounds, but they also come with limitations
  • The connection speed is not as good as on native Windows systems

Root access

For root-access, open /etc/pam.d/sddm and comment out the line:

#auth   required user != root quiet_success

What about Gnome and others?

Well, xrdp also works on Gnome and others. For Gnome and further research I found this pretty helpful


Thanks to WitchCraft and c-nergy

Andreas Fuhrich avatar
About Andreas Fuhrich
I’m a professional software developer and tech enthusiast from Germany. On this website I share my personal notes and side project details. If you like it, you could support me on github - if not, feel free to file an issue :-)