Introduction
Welcome to this comprehensive guide on addressing the Kali Linux XRDP backscreen disconnects issue. This article is specifically tailored for a global audience seeking to learn about XRDP and how to troubleshoot disconnects on Kali Linux installations.
What is XRDP and its purpose
XRDP (X Remote Desktop Protocol) is an open-source implementation of the Remote Desktop Protocol (RDP) that allows users to remotely connect to another computer over a network connection. It uses the xrdp and xorgxrdp packages, making it possible to connect to a Linux system from a Windows, Mac, or Linux machine using an RDP client like Remote Desktop Connection (Windows) or rdesktop/FreeRDP (Linux).
Setting up XRDP on a Kali Linux system
To set up XRDP on a Kali Linux system, follow these steps:
-
Install the necessary packages:
# apt-get update && apt-get install xrdp xorgxrdp -
Enable the XRDP service:
# systemctl enable xrdp -
Start the XRDP service:
# systemctl start xrdp -
(Optional) Change the default desktop session to a lighter one, like XFCE:
# echo xfce4-session > ~/.xsession
Troubleshooting XRDP backscreen disconnects
In some cases, a Kali Linux XRDP setup may suffer from backscreen disconnects—where the connection drops after a short period of inactivity. This issue can be due to several factors, including power management, screen locking, and session settings.
Power management
A common cause of backscreen disconnects is power management settings. You can disable power management on XRDP connections by editing the /etc/X11/xrdp/startwm.sh file:
# sed -i 's/# xset s noblank/# xset s noblank
exit 0/' /etc/X11/xrdp/startwm.sh
Screen locking
Screen locking can also be a culprit for backscreen disconnects. To disable it, edit the /etc/lightdm/lightdm.conf file:
# sed -i 's/# greeter-session=example-gtk-greeter/greeter-session=lightdm-gtk-greeter
xserver-command=X -s 0 -dpms
xrdp-session=Xfce4
# pam-service=lightdm-autologin/pam-service=lightdm/' /etc/lightdm/lightdm.conf
Session settings
Setting the correct session timeout value can help mitigate backscreen disconnects. Edit the /etc/xrdp/sesman.ini file to change the timeout value:
# sed -i 's/# max_disconnect_time=5/max_disconnect_time=1200/' /etc/xrdp/sesman.ini
- XRDP is a Remote Desktop Protocol implementation that allows remote connections to a Linux system
- Setting up XRDP in Kali Linux requires installing the packages
xrdpandxorgxrdpand starting the XRDP service - Addressing backscreen disconnects requires altering power management, screen locking, and session settings in specific configuration files
References
-
Book: Kali Linux: Mastering the Penetration Testing Distribution
By Gerhard Essl -
Article: How To Set Up XRDP On Ubuntu
By Ryan D. Boland
https://www.howtoforge.com/how-to-set-up-xrdp-on-ubuntu/ -
Online Resource: XRDP Wiki
By XRDP Community
https://github.com/neutrinolabs/xrdp