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.
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:
- Navigate to the
/usr/share/polkit-1/actions/directory by executing the following command:
- Open the
org.freedesktop.color.policyfile using a text editor, such as vi:
sudo vi org.freedesktop.color.policy
- Modify the
- Save the changes and reboot the system.
Solution 3: Edit the
Another solution is to edit the
startwm.sh file, which is the script that starts the xrdp session. Here’s how to do it:
- Open the
startwm.shfile using a text editor, such as nano:
sudo nano /etc/xrdp/startwm.sh
- Add the following lines at the very top of the file:
These commands remove the DBUS_SESSION_BUS_ADDRESS and XDG_RUNTIME_DIR environment variables, which may be causing the black screen issue.
- 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:
- Download the script:
- Unzip the downloaded file:
- Run the script:
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:
- Disable and stop the xrdp service:
sudo systemctl disable xrdp
sudo systemctl stop xrdp
- Remove xrdp and related packages:
sudo apt purge xrdp xserver-xorg-core xserver-xorg-input-all xorgxrdp
- Reinstall xrdp and required packages:
sudo apt install xrdp xserver-xorg-core xserver-xorg-input-all xorgxrdp
- Grant access to the
/etc/ssl/private/ssl-cert-snakeoil.keyfile for the xrdp user:
sudo adduser xrdp ssl-cert
- Start and enable the xrdp service:
sudo systemctl start xrdp
sudo systemctl enable xrdp
- Configure the firewall to allow access on port 3389 if necessary.
Solution 6: Check the Content of the
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.
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.
Xrdp is an open-source Remote Desktop Protocol (RDP) server that allows users to remotely control a system using a graphical interface.
The black screen issue can occur due to various reasons such as incorrect configuration settings, software bugs, or compatibility issues.
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".
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
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.
To use the xrdp installation script provided by Griffon, you need to download the script, unzip it, and run it using the command
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.
You can grant access to the
ssl-cert-snakeoil.key file for the xrdp user by using the command
sudo adduser xrdp ssl-cert.
You can start and enable the xrdp service using the commands
sudo systemctl start xrdp and
sudo systemctl enable xrdp, respectively.