This repository provides a helper script to install and configure XRDP on Ubuntu, ensure desktop environments (XFCE or GNOME) are set up properly, and force GDM to run in Xorg mode (disabling Wayland).
It also writes a clean ~/.xsession so that XRDP sessions start directly in the chosen desktop environment, instead of dropping users back to the purple GDM login screen.
- Installs XRDP with Xorg backend
- Installs desktop environment of your choice:
- XFCE4 (lightweight, stable for XRDP)
- GNOME (Ubuntu session) (requires Xorg)
- Forces GDM to Xorg by ensuring
WaylandEnable=falsein/etc/gdm3/custom.conf - Creates per-user
~/.xsessionto cleanly launch desktop sessions - Fixes ownership of
.Xauthorityand.ICEauthorityto prevent login crashes - Verifies
/etc/xrdp/startwm.shdelegates toXsession(per-user control) - Restarts XRDP and GDM automatically after configuration
- Ubuntu 22.04 (Jammy), 24.04 (Noble), or later
- User account already created (e.g.,
ubuntu) - Run as root or via
sudo
-
Save the script:
git clone https://github.com/kyroskoh/setup-xrdp-script.git chmod +x setup-xrdp.sh
-
Run with desired desktop environment:
-
XFCE (recommended for XRDP):
sudo bash setup-xrdp.sh --desktop xfce --user ubuntu
-
GNOME (Ubuntu session, must use Xorg):
sudo bash setup-xrdp.sh --desktop gnome --user ubuntu
-
-
Connect via Microsoft Remote Desktop (or any RDP client) using the system’s IP address and the Linux username/password.
# Install XRDP + XFCE for user 'ubuntu'
sudo bash setup-xrdp.sh --desktop xfce --user ubuntu
# Connect from Windows or macOS RDP client:
# - PC name: <server-ip>
# - Username: ubuntu
# - Password: <user-password>-
RDP window closes immediately
Check logs:cat ~/.xsession-errors tail -n 100 /var/log/xrdp-sesman.log tail -n 100 /var/log/xrdp.log -
Still seeing GDM login screen
Ensure/etc/gdm3/custom.confcontains:[daemon] WaylandEnable=falseThen:
sudo systemctl restart gdm3
-
Blank/black screen
Verify~/.xsessioncontains only:exec startxfce4or, for GNOME:
export GNOME_SHELL_SESSION_MODE=ubuntu export XDG_CURRENT_DESKTOP=ubuntu:GNOME exec gnome-session --session=ubuntu
- XFCE is generally lighter and more reliable for XRDP.
- GNOME works but requires forcing Xorg.
- The script makes backups of:
/etc/gdm3/custom.conf/etc/xrdp/startwm.sh
MIT License