Software & AppsOperating SystemLinux

Fixing Xrdp Black Screen Issue on Ubuntu 20.04

Ubuntu 11

In this article, we will delve into the problem of the black screen issue that users often encounter when using xrdp on Ubuntu 20.04. We will provide a comprehensive guide on how to troubleshoot and fix this issue using various methods.

Introduction

Xrdp is an open-source Remote Desktop Protocol (RDP) server that allows you to graphically control a remote system. Despite its utility, users often report a persistent issue where they encounter a black screen when trying to use xrdp on Ubuntu 20.04. This problem can occur due to a variety of reasons, such as incorrect configuration settings, software bugs, or compatibility issues.

Solution 1: Log Out of the Desktop Session

The first solution you can try is to log out of the desktop session on the machine before attempting to connect via RDP. This method has been reported to solve the black screen issue for some users.

Solution 2: Configure Xrdp to Ignore Warning Messages

In some cases, the black screen issue may be caused by a warning message, “Authentication is required to create a color managed device”. To configure xrdp to ignore this warning, follow these steps:

  1. Navigate to the /usr/share/polkit-1/actions/ directory by executing the following command:
cd /usr/share/polkit-1/actions/
  1. Open the org.freedesktop.color.policy file using a text editor, such as vi:
sudo vi org.freedesktop.color.policy
  1. Modify the <allow_any> settings from auth_admin to yes:
<defaults> 
 <allow_any>yes</allow_any>
 <allow_inactive>no</allow_inactive>
 <allow_active>yes</allow_active>
</defaults>
  1. Save the changes and reboot the system.

Solution 3: Edit the startwm.sh File

Another solution is to edit the startwm.sh file, which is the script that starts the xrdp session. Here’s how to do it:

  1. Open the startwm.sh file using a text editor, such as nano:
sudo nano /etc/xrdp/startwm.sh
  1. Add the following lines at the very top of the file:
unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR

These commands remove the DBUS_SESSION_BUS_ADDRESS and XDG_RUNTIME_DIR environment variables, which may be causing the black screen issue.

  1. Save the changes and restart the xrdp service:
sudo systemctl restart xrdp

Solution 4: Use the Xrdp Installation Script

Griffon from the c-nergy.be website has provided an xrdp installation script that can help resolve this issue. Follow these steps to use the script:

  1. Download the script:
wget https://www.c-nergy.be/downloads/xrdp-installer-1.2.2.zip
  1. Unzip the downloaded file:
unzip xrdp-installer-1.2.2.zip 
  1. Run the script:
bash xrdp-installer-1.2.2.sh

Solution 5: Reinstall Xrdp and Related Packages

If none of the above solutions work, you can try completely removing xrdp and related packages and then reinstalling them. Here’s how:

  1. Disable and stop the xrdp service:
sudo systemctl disable xrdp
sudo systemctl stop xrdp
  1. Remove xrdp and related packages:
sudo apt purge xrdp xserver-xorg-core xserver-xorg-input-all xorgxrdp
  1. Reinstall xrdp and required packages:
sudo apt install xrdp xserver-xorg-core xserver-xorg-input-all xorgxrdp
  1. Grant access to the /etc/ssl/private/ssl-cert-snakeoil.key file for the xrdp user:
sudo adduser xrdp ssl-cert
  1. Start and enable the xrdp service:
sudo systemctl start xrdp
sudo systemctl enable xrdp
  1. Configure the firewall to allow access on port 3389 if necessary.

Solution 6: Check the Content of the startwm.sh File

Lastly, you can check the content of the /etc/xrdp/startwm.sh file and compare it with a working system. If the content is different, restore the original content of the file.

Conclusion

In this article, we have discussed six potential solutions to the xrdp black screen issue on Ubuntu 20.04. While these solutions have been reported to work for many users, it’s important to remember that the effectiveness of each solution may vary depending on the specific configuration of your system. If none of the above solutions work, it is recommended to check for any additional error messages or logs that may provide more information about the issue.

What is xrdp?

Xrdp is an open-source Remote Desktop Protocol (RDP) server that allows users to remotely control a system using a graphical interface.

Why do I see a black screen when using xrdp on Ubuntu 20.04?

The black screen issue can occur due to various reasons such as incorrect configuration settings, software bugs, or compatibility issues.

How do I log out of the desktop session on Ubuntu 20.04?

To log out of the desktop session, you can click on the user icon in the top-right corner of the screen and select "Log Out".

How do I modify the `org.freedesktop.color.policy` file?

You can modify the org.freedesktop.color.policy file by navigating to the /usr/share/polkit-1/actions/ directory, opening the file using a text editor, and changing the <allow_any> settings from auth_admin to yes.

How do I edit the `startwm.sh` file?

You can edit the startwm.sh file by opening it with a text editor, such as nano, using the command sudo nano /etc/xrdp/startwm.sh, and adding the necessary lines at the very top of the file.

How do I use the xrdp installation script?

To use the xrdp installation script provided by Griffon, you need to download the script, unzip it, and run it using the command bash xrdp-installer-1.2.2.sh.

How do I reinstall xrdp and related packages?

To reinstall xrdp and related packages, you need to disable and stop the xrdp service, remove the packages using the command sudo apt purge, and then reinstall them using the command sudo apt install.

How do I grant access to the `ssl-cert-snakeoil.key` file for the xrdp user?

You can grant access to the ssl-cert-snakeoil.key file for the xrdp user by using the command sudo adduser xrdp ssl-cert.

How do I start and enable the xrdp service?

You can start and enable the xrdp service using the commands sudo systemctl start xrdp and sudo systemctl enable xrdp, respectively.

Leave a Comment

Your email address will not be published. Required fields are marked *