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:
- Navigate to the
/usr/share/polkit-1/actions/
directory by executing the following command:
cd /usr/share/polkit-1/actions/
- Open the
org.freedesktop.color.policy
file using a text editor, such as vi:
sudo vi org.freedesktop.color.policy
- Modify the
<allow_any>
settings fromauth_admin
toyes
:
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
- 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:
- Open the
startwm.sh
file using a text editor, such as nano:
sudo nano /etc/xrdp/startwm.sh
- 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.
- 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:
wget https://www.c-nergy.be/downloads/xrdp-installer-1.2.2.zip
- Unzip the downloaded file:
unzip xrdp-installer-1.2.2.zip
- 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:
- 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.key
file 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 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.
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 auth_admin
to yes
.
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 bash xrdp-installer-1.2.2.sh
.
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.