Update

sudo apt update
sudo apt -y install xrdp
sudo systemctl status xrdp
sudo adduser xrdp ssl-cert
sudo ufw allow 3389
sudo systemctl restart xrdp

Install Your Preferred Desktop Environment
Install XFCE Desktop Environment

sudo apt install task-xfce-desktop

Install MATE Desktop Environment

sudo apt install task-mate-desktop

Install KDE Plasma Desktop Environment

sudo apt install task-kde-desktop

Install Cinnamon Desktop Environment

sudo apt install task-cinnamon-desktop

Switching Between Desktop Environments

sudo update-alternatives – config x-session-manager

See Below for GNOME and XRDP

install GNOME

sudo apt-get install task-gnome-desktop

For Debian 11, The XRDP package results in an error.

The problem seems to happens only with Gnome Desktop. We have tested the same setup but with KDE desktop and everything is working as expected.

Based the the bug/issue reported to the team behind xrdp software (see https://github.com/neutrinolabs/xorgxrdp/issues/156), the problem is only present when using the xorgxrdp package version 0.2.12. Previous version of Debian (Debian 10) was using the package version 0.2.9 and we didn’t encountered the issue…Debian 11 is shipping with the problematic version (i.e. 0.2.12) and this explain why the connection is failing.

The only fix proposed by xRDP team is basically to upgrade the xorgxrdp package to a more recent version which is exactly what’s happening when you are performing the custom installation….

So lets remove xrdp if installed.

# sudo apt remove xrdp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  xrdp
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 3022 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 297587 files and directories currently installed.)
Removing xrdp (0.9.12-1.1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...

Check version

# sudo xrdp -v
sudo: xrdp: command not found

Let upgrade xrdp

cd ~/Downloads
wget https://www.c-nergy.be/downloads/xRDP/xrdp-installer-preview-2021.zip
unzip xrdp-installer-preview-2021.zip 
chmod +x  ~/Downloads/xrdp-installer-preview-2021.sh
./xrdp-installer-preview-2021.sh -c -l

Check version

$ sudo xrdp -v
xrdp 0.9.17
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-fuse
      --enable-jpeg
      --enable-rfxcodec

  Compiled with OpenSSL 1.1.1k  25 Mar 2021

Fix: Authentication Required Prompt

On some desktop environments, some nagging prompts require additional authentication.

You can dismiss them and continue the session without it popping up again, but that is a temporary fix, as it will pop up later.

Debian uses a framework called Polkit, which handles application authorization. It captures actions that the user is attempting to perform and checks if they are authorized or if they aren’t and need to authenticate for them to be authorized. Polkit reads some policy files to determine this.

What we’ll do is create such a policy file ourselves.

Create and edit the file with your preferred text editor.

$ sudo nano /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

And paste the following:

polkit.addRule(function(action, subject) {
 if ((action.id == "org.freedesktop.color-manager.create-device" ||
 action.id == "org.freedesktop.color-manager.create-profile" ||
 action.id == "org.freedesktop.color-manager.delete-device" ||
 action.id == "org.freedesktop.color-manager.delete-profile" ||
 action.id == "org.freedesktop.color-manager.modify-device" ||
 action.id == "org.freedesktop.color-manager.modify-profile" ||
 action.id == "org.freedesktop.packagekit.system-sources-refresh" || action.id == "org.freedesktop.packagekit.system-network-proxy-configure") &&
 subject.isInGroup("{users}")) {
 return polkit.Result.YES;
 }
});

Ref: https://tecadmin.net/how-to-install-

xRDP – Detected issues with Debian 11 – Oh No ! Something has gone wrong….

How to Connect to a Debian 10 Server via Remote Desktop Connection using xRDP