This guide captures the exact fix used to resolve XRDP black screen / immediate disconnects while keeping the full GNOME experience for local (physical) login via GDM.
- Physical login: GNOME (unchanged, full experience).
- RDP login: XFCE (stable, no black screen).
- Reason: GNOME-on-XRDP often fails/black screens due to GNOME/Xorg/systemd user-session interactions. XFCE is reliable under XRDP.
- Ubuntu 25
- XRDP installed and running
ghinstalled and authenticated (for gist publishing only)
sudo apt-get update
sudo apt-get install xfce4Create or edit ~/.xsession:
cat > ~/.xsession <<'EOX'
#!/bin/bash
exec startxfce4
EOX
chmod +x ~/.xsessionThis file only affects XRDP sessions and does not change the GNOME experience when logging in physically via GDM.
- Disconnect your RDP session
- Reconnect
You should land in an XFCE desktop.
- Clear the XRDP session error log for a fresh run:
: > ~/.xsession-errors- Reconnect, then check:
tail -n 120 ~/.xsession-errors
ps -ef | rg -n 'startxfce4|xfce|xfce4-session|Xorg.*:10|xrdp-chansrv'If startxfce4 or xfce4-session is missing, XFCE is not launching.
GNOME over XRDP was unstable and produced a black screen. If you want to experiment, you can set:
cat > ~/.xsession <<'EOX'
#!/bin/bash
exec gnome-session --session=ubuntu
EOXBut this setup was unreliable in practice and caused black screen for RDP while GNOME still worked locally.
These custom GNOME systemd user targets were created earlier and removed to restore defaults:
~/.config/systemd/user/gnome-session-x11.target
~/.config/systemd/user/[email protected]
/var/log/xrdp.log/var/log/xrdp-sesman.log~/.xsession-errors~/.xorgxrdp.10.log
~/.xsessionaffects XRDP sessions, not physical GDM login.- XFCE provides the most stable XRDP experience on Ubuntu 25.