Skip to content

Instantly share code, notes, and snippets.

@andreabalducci
Created January 27, 2026 13:36
Show Gist options
  • Select an option

  • Save andreabalducci/8b46f03c946b40d61ae82f35c0d8e9b9 to your computer and use it in GitHub Desktop.

Select an option

Save andreabalducci/8b46f03c946b40d61ae82f35c0d8e9b9 to your computer and use it in GitHub Desktop.
Configure RDP for Ubuntu 25 (XRDP)

Configure RDP for Ubuntu 25 (XRDP) — Working Setup + GNOME preserved

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.

Summary of the final working state

  • 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.

Prerequisites

  • Ubuntu 25
  • XRDP installed and running
  • gh installed and authenticated (for gist publishing only)

Install XFCE (for RDP sessions)

sudo apt-get update
sudo apt-get install xfce4

Set XRDP to start XFCE

Create or edit ~/.xsession:

cat > ~/.xsession <<'EOX'
#!/bin/bash
exec startxfce4
EOX

chmod +x ~/.xsession

This file only affects XRDP sessions and does not change the GNOME experience when logging in physically via GDM.

Restart XRDP session

  • Disconnect your RDP session
  • Reconnect

You should land in an XFCE desktop.

Troubleshooting: XRDP session is still black

  1. Clear the XRDP session error log for a fresh run:
: > ~/.xsession-errors
  1. 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.

Optional: GNOME over RDP (not recommended)

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
EOX

But this setup was unreliable in practice and caused black screen for RDP while GNOME still worked locally.

Cleanup (done)

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]

Logs referenced during debugging

  • /var/log/xrdp.log
  • /var/log/xrdp-sesman.log
  • ~/.xsession-errors
  • ~/.xorgxrdp.10.log

Notes

  • ~/.xsession affects XRDP sessions, not physical GDM login.
  • XFCE provides the most stable XRDP experience on Ubuntu 25.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment