How to Fix XRDP Ubuntu Black Screen After Login

How to Fix XRDP Ubuntu Black Screen After Login? Step by Step Guide

If you’re trying to connect to your Ubuntu system remotely using XRDP Ubuntu black screen after login in, you’re not alone. This frustrating issue has been experienced by many users across different versions of Ubuntu, especially after recent updates or fresh installations.

In this article, we’ll explain why the XRDP black screen appears on Ubuntu after login, and we’ll walk you through step-by-step solutions to resolve it. Whether you’re running Ubuntu 20.04, 22.04, or newer, this guide is designed to help beginners and advanced users alike.

What Is XRDP?

XRDP is an open-source implementation of Microsoft’s Remote Desktop Protocol (RDP) that allows users to access Linux desktops remotely from any RDP client (like Windows Remote Desktop Connection). It’s a great tool for system administrators, developers, and anyone who wants remote GUI access to Ubuntu.

Common Symptoms of the Black Screen Issue

When the black screen issue strikes, here’s what typically happens:

  • You connect using RDP (from Windows or another machine).
  • You enter your credentials and hit login.
  • Instead of seeing your desktop environment, you get a completely black screen.
  • The connection may hang or close after a while.

Causes of the XRDP Black Screen on Ubuntu

There isn’t a single reason for this problem. Several factors can contribute:

  1. Conflict with the default desktop environment (e.g., GNOME or Wayland).
  2. Missing .xsession or .xinitrc configuration files.
  3. Incorrect permissions on user directories.
  4. XRDP trying to use Wayland instead of Xorg.
  5. Running multiple desktop sessions.
  6. Missing or misconfigured packages like xorgxrdp.

Now, let’s move on to the solutions.

How to Fix XRDP Ubuntu Black Screen After Login

Step 1: Ensure You Are Using Xorg, Not Wayland

Ubuntu uses Wayland as the default display server in some versions (like Ubuntu 22.04), which isn’t compatible with XRDP.

Solution:

  1. Edit the file /etc/gdm3/custom.conf:
    bash   Copy
    sudo nano /etc/gdm3/custom.conf
  2. Uncomment or add the following line:
    ini    Copy
    WaylandEnable=false
    Save and exit (Ctrl+O, Enter, Ctrl+X).
  3. Reboot your system:
    bash   Copy
    sudo reboot
    This forces Ubuntu to use Xorg instead of Wayland.

Step 2: Install Required XRDP Packages

You want the xrdp & xorgxrdp packages installed properly.

bash   Copy
sudo apt update
sudo apt install xrdp xorgxrdp

Then enable and start the XRDP service:

bash   Copy
sudo systemctl enable xrdp
sudo systemctl start xrdp

Check its status:

bash   Copy
sudo systemctl status xrdp

Step 3: Set Up .xsession File

Sometimes, XRDP doesn’t know what desktop environment to launch.

Make or edit the .xsession file in your home indicative:

bash   Copy
echo "gnome-session" > ~/.xsession

Or if you’re using Xfce (a lightweight desktop):

bash   Copy
echo "startxfce4" > ~/.xsession

Make sure your user owns the file:

bash   Copy
chmod +x ~/.xsession

This tells XRDP what desktop environment to load when you log in.

Step 4: Install and Configure Xfce4 (Optional but Recommended)

If GNOME is giving you problems, switch to a lighter desktop environment like Xfce.

bash   Copy
sudo apt install xfce4 xfce4-goodies

Then update your .xsession file to use Xfce:

bash   Copy
echo "startxfce4" > ~/.xsession

Restart XRDP:

bash   Copy
sudo systemctl restart xrdp

Now try connecting again via Remote Desktop.

Step 5: Fix Permissions on Home Directory

Incorrect permissions can prevent XRDP from launching a session.

Run this command:

bash   Copy
chmod 755 ~

This ensures XRDP can access your .xsession and related config files.

Step 6: Allow Polkit Permissions (If Needed)

Some users see a black screen because the policy kit blocks access.

Edit or create a Polkit file:

bash   Copy
sudo nano /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla

Add this content:

ini   Copy
[Allow colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Then restart your system:

bash   Copy
sudo reboot

Testing Your Setup

  1. Open Remote Desktop Connection on a Windows PC.
  2. Enter the IP address of your Ubuntu machine.
  3. Log in with your Ubuntu username and password.
  4. You should now see your desktop (GNOME or Xfce).

If you’re still getting a black screen, go back and check your .xsession, permissions, and display server settings.

Bonus Tip: Enable Clipboard and File Sharing in XRDP

To make your remote session more productive:

  1. Enable clipboard sharing with:
    bash   Copy
    sudo apt install xrdp-sesman
  2. Install xrdp-pulseaudio-installer for sound forwarding:
    bash   Copy
    sudo apt install xrdp-pulseaudio-installer

XRDP Alternatives

If XRDP continues to be problematic, consider alternatives like:

  • VNC (TigerVNC, RealVNC) – Easier setup, but not as responsive.
  • NoMachine – Great for performance.
  • TeamViewer or AnyDesk – More user-friendly but proprietary.

Conclusion

The XRDP black screen after login issue on Ubuntu is a common yet solvable problem. It usually stems from a combination of display server incompatibility, misconfigured desktop sessions, or missing configuration files.

By following the steps above, especially switching to Xorg, configuring .xsession, & installing a lightweight computer—you can restore full remote access in minutes.

Quick Recap:

  • Use Xorg, not Wayland.
  • Create a proper .xsession file.
  • Try using Xfce for better compatibility.
  • Fix file permissions and restart XRDP service.

Now that you’ve solved the issue, enjoy seamless remote access to your Ubuntu system with XRDP!

Scroll to Top