Use the excellent script of c-nergy.be who deserve all credit for this solution.

xRDP – Easy install xRDP on Ubuntu 22.04,24.04,24.10,25.04 (Script Version 1.5.4) – Griffon's IT Library

Run the following code in an ubuntu client running on a proxmox host.

wget <https://www.c-nergy.be/downloads/xRDP/xrdp-installer-1.5.4.zip>
unzip xrdp-installer-1.5.4.zip 
chmod +x  ~/Downloads/xrdp-installer-1.5.4.sh

The script needs to be run as a normal user and in the ubuntu desktop shell - not via ssh !

./xrdp-installer-1.5.4.sh

Whenever I tried to login i got an error that " I need to log out of my local session" as mentioned above. Maybe due to the proxmox webconsole.

I used the description in https://c-nergy.be/blog/?p=16698

sudo nano /etc/xrdp/startwm.sh

and added

export $(dbus-launch)

before

############ added to ignore local logon
export $(dbus-launch)
############

# debian
if [ -r /etc/X11/Xsession ]; then

after a restart of xrdp with "sudo systemctl restart xrdp" I could login with the remote desktop manager from windows

( after unchecking "Show Options" -> Advanced -> Use a web account to sign in in remote desktop manager)