Installing RDP on Ubuntu 22.04 LTS Desktop version

It maybe very surprising

That one want to install RDP instead of using VNC on a Linux system however I figrued that since Microsoft Remote Desktop client is readily available for Mac, Windows(Windows Store App or Remote Desktop Connection classic windows application built-in) as well as iOS and Android devices I would prefer this route.

Dated documentation lacking maintainence

Is always an issue with open source community, this time it is not an exception.
I carefully consulted Google and Bing GPT-4 chatbot however they were not able to find me any up-to-date documentaion that works. The closest I found is this article about setting up xrdp on Ubuntu 18.04.

Time to write my own guide

Turns out the document I found above is more than helpful, at least we know we need xrdp package installed as our first step, if it isn’t obvious until now.

Here are the steps worked for me:

  1. Install xrdp: sudo apt-get -y install xrdp .
  2. When I checked the configuration file located at /etc/xrdp/xrdp.ini it seemed the crypt_level is already set to high, there are no such parameter called encrypt_level, maybe it is renamed.
  3. Run sudo systemctl status xrdp to check xrdp status, run sudo systemctl enable xrdp, sudo systemctl start xrdp or sudo systemctl restart xrdp as needed.
  4. Verify the xrdp and xrdp-sesm processes are listening for connections, run sudo lsof -nP -iTCP -sTCP:LISTEN to see all listening TCP ports.
  5. You should now run the sudo ufw status to verify if the firewall of Ubuntu is enabled, in my case it was enabled by me earlier so I indeed need to run sudo ufw allow 3389/tcp in order to allow incoming traffic on TCP port 3389. Freshly installed Ubuntu 22.04 LTS might not be running firewall by default.
  6. You don’t need polkit configration related tweaks so simply skip it.
  7. Next go to Settings - Sharing and toggle the switch in top right corner to on:
    filename already exists, renamed
  8. Natrually, next step would be proceeding to Remote Desktop item, switch both the Remote Desktop and Remote Control options on. The authentication section should show you the current credentials you used to login to Ubuntu:
    upload successful

You’re done, now you should be able to connect to your Ubuntu 22.04 LTS Desktop version via RDP, be very careful that xrdp does not seemed to support NLA(Network Level Authentication), tracked by this issue.

Bonus points: