Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

XRDP + Desktop Environment Setup (Ubuntu)

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.


Features

  • 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=false in /etc/gdm3/custom.conf
  • Creates per-user ~/.xsession to cleanly launch desktop sessions
  • Fixes ownership of .Xauthority and .ICEauthority to prevent login crashes
  • Verifies /etc/xrdp/startwm.sh delegates to Xsession (per-user control)
  • Restarts XRDP and GDM automatically after configuration

Requirements

  • Ubuntu 22.04 (Jammy), 24.04 (Noble), or later
  • User account already created (e.g., ubuntu)
  • Run as root or via sudo

Usage

  1. Save the script:

    git clone https://github.com/kyroskoh/setup-xrdp-script.git
    chmod +x setup-xrdp.sh
  2. 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
  3. Connect via Microsoft Remote Desktop (or any RDP client) using the system’s IP address and the Linux username/password.


Example

# 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>

Troubleshooting

  • 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.conf contains:

    [daemon]
    WaylandEnable=false
    

    Then:

    sudo systemctl restart gdm3
  • Blank/black screen
    Verify ~/.xsession contains only:

    exec startxfce4

    or, for GNOME:

    export GNOME_SHELL_SESSION_MODE=ubuntu
    export XDG_CURRENT_DESKTOP=ubuntu:GNOME
    exec gnome-session --session=ubuntu

Notes

  • 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

License

MIT License

About

XRDP + Desktop Environment Setup (Ubuntu). Supports (XFCE or GNOME)

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages