How to Fix XRDP Ubuntu Black Screen After Login
Using XRDP to remotely access an Ubuntu machine is a powerful way to manage your Linux environment from anywhere. However, many users face a common and frustrating issue: the infamous black screen after login. After entering your credentials via Remote Desktop Protocol (RDP), instead of seeing your desktop, you’re greeted with a black void — and nothing more.
This article breaks down the common causes and solutions for the XRDP black screen issue on Ubuntu, helping you quickly get back to a functional remote desktop.
What Causes the XRDP Black Screen Issue?
Before diving into fixes, it helps to understand what causes the problem. The black screen typically appears due to:
-
Incompatible desktop environments (DE)
-
Missing or misconfigured
.xsession
file -
Permissions issues
-
Conflicts with Wayland (used in newer versions of Ubuntu)
-
Incomplete XRDP or Xorg configurations
Now, let’s walk through the proven solutions.
Step-by-Step Fixes
1. Install a Compatible Desktop Environment
XRDP doesn’t play nicely with GNOME (Ubuntu's default DE in recent versions). A lightweight desktop environment like Xfce is more stable and widely used with XRDP.
🔧 To install Xfce:
2. Configure XRDP to Use Xfce
Once installed, you need to tell XRDP to launch Xfce upon login.
🔧 Create or Edit .xsession
:
Make sure the file is readable:
Tip: Do this as the user who will be logging in via RDP.
3. Install and Configure XRDP
If you haven’t installed XRDP yet:
Ensure the XRDP service is running:
You can check the status with:
4. Disable Wayland (Ubuntu 22.04+ Specific)
Wayland is a display server protocol that isn’t fully compatible with XRDP. To ensure smooth remote sessions, switch to Xorg.
🔧 Edit the GDM config file:
Uncomment or add the line:
Save and close the file (Ctrl + O
, Enter
, Ctrl + X
), then reboot:
5. Grant Access to the XRDP Session
Sometimes, the session isn’t created properly due to missing privileges.
🔧 Add user to the ssl-cert
group:
Restart XRDP afterward:
6. Fix PolKit Permissions
PolKit can block access to system services. Create a policy to allow XRDP users.
🔧 Create a new policy file:
Paste this:
This allows XRDP users to interact with colord and avoids permission-related crashes.
7. Check and Set Session File for XRDP
Ubuntu may not automatically know which session to start.
🔧 Create or modify /etc/xrdp/startwm.sh
:
Before modifying, back up the file:
Then edit:
Comment out these lines (if present):
And add:
Save and restart XRDP:
8. Verify File Ownership and Permissions
Incorrect file ownership can prevent proper session loading.
🔧 Ensure .xsession
is owned by the correct user:
If it’s not owned by you, fix it:
9. Update and Reboot
Sometimes a quick update and reboot clears up lingering issues:
Bonus Tips for Troubleshooting
If it still doesn’t work:
-
Check logs for errors:
-
Try a different user account. Sometimes, a corrupted home directory can cause issues.
-
Ensure you log out physically from the system before logging in via XRDP, to avoid session conflicts.
Security Tip
Don’t expose XRDP directly to the internet. Always use a VPN or SSH tunnel when accessing your system remotely.
Example SSH tunnel:
Final Thoughts
The XRDP black screen on Ubuntu can be frustrating, but it's usually fixable with a few adjustments. Switching to a compatible desktop environment like Xfce, configuring your session properly, and ensuring XRDP uses Xorg (not Wayland) can resolve the majority of issues.
With these fixes in place, your remote Ubuntu desktop should be up and running, and that black screen will be a thing of the past.
Comments
Post a Comment