Short answer
The most common cause of a black screen after the xrdp login is that the same user is still logged in on the Ubuntu computer itself. Log out there, then connect again. If that doesn’t help, the fixes below cover the other causes on Ubuntu 22.04 and 24.04.
- The user still signed in on the Ubuntu computer: log out here.
- The remote desktop window stays black.
One user can't have a desktop on the Ubuntu screen and an xrdp desktop at the same time.
Run the commands on the Ubuntu computer, in a terminal (Ctrl + Alt + T) or over SSH. In nano, save with Ctrl + O and Enter, then close with Ctrl + X.
Fix 1: Log out of the desktop session
On Ubuntu, one user can’t be logged in on the computer’s screen and over xrdp at the same time: both sessions would share one session bus. On the Ubuntu computer, open the system menu and choose Power Off / Log Out, Log Out. Then connect again. Or connect as a different user.
Fix 2: Edit startwm.sh
Settings left over from the local login can stop the remote desktop from starting.
-
Back up the file:
sudo cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.bak -
Open it:
sudo nano /etc/xrdp/startwm.sh -
Add these lines right after the first line (
#!/bin/sh):unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR -
Save and restart xrdp:
sudo systemctl restart xrdp
No difference? Put the backup back with sudo cp /etc/xrdp/startwm.sh.bak /etc/xrdp/startwm.sh.
The desktop opens but looks like plain GNOME, without the Ubuntu dock? Add these two lines in the same place, then restart xrdp. Or put them in ~/.xsessionrc for your user only:
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOMEFix 3: Give xrdp access to its certificate
xrdp needs to read the system’s SSL certificate key. If it can’t, the login can fail. On 22.04 and 24.04, add the xrdp user to the ssl-cert group:
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdpFix 4: Stop the “color managed device” prompt (22.04)
The remote session can hang on a hidden prompt: “Authentication is required to create a color managed device”. On 24.04 and newer, the xrdp package already allows this, so skip this fix. On 22.04, allow only these color actions in a file of your own:
-
Create the file:
sudo nano /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla -
Paste these lines:
[Allow colord for active users] Identity=unix-user:* Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile ResultAny=no ResultInactive=no ResultActive=yes -
Save and restart the computer.
This lets any logged-in user change color profiles without a password. To undo it, delete the file.
Fix 5: Reinstall xrdp
This keeps your settings in /etc/xrdp.
sudo apt install --reinstall xrdp xorgxrdp
sudo systemctl enable --now xrdpThen repeat Fix 3. Still black? Look for errors in ~/.xsession-errors, /var/log/xrdp.log and /var/log/xrdp-sesman.log.
Hyper-V virtual machines
Hyper-V’s Enhanced Session connects to a Linux machine over RDP, through xrdp inside it. If it shows a black screen, turn off Enhanced Session with its icon in the virtual machine window’s toolbar. You get the basic console, where you can log in and apply the fixes above.
The built-in alternative: GNOME Remote Desktop
Ubuntu 24.04 and newer have their own RDP server, with no xrdp needed. It’s the way to reach the Ubuntu desktop on 26.04. Use one or the other: both listen on port 3389.