How to setup Xrdp on Ubuntu 22.04

What is XRDP?
XRDP is an open-source Remote Desktop Protocol (RDP) server that allows you to connect to a Linux machine from a Windows computer using the built-in Remote Desktop Connection (RDP) tool. It provides a graphical interface for remote access, making it easy to work on your Linux system from anywhere.

Basics requirements:
OS – Ubuntu 22.04
runlevel – 5
Port – 3389 ( Enable on Server)

Update system packages and install XRDP:
sudo apt update && sudo apt install xrdp -y

Install a Desktop Environment
Since GNOME (default in Ubuntu 22.04) does not work well with XRDP, install XFCE (a lightweight desktop environment):

sudo apt install xfce4 xfce4-terminal -y
echo "xfce4-session" > ~/.xsession

Configure XRDP Settings
Modify security settings to allow basic RDP connections:

sudo sed -i 's/security_layer=negotiate/security_layer=rdp/' /etc/xrdp/xrdp.ini
sudo sed -i 's/crypt_level=high/crypt_level=low/' /etc/xrdp/xrdp.ini

Enable and start XRDP service:

sudo systemctl restart xrdp
sudo systemctl enable xrdp
sudo systemctl status xrdp

Verify XRDP is Running on Port 3389

$ sudo netstat -tlnp | grep 3389
tcp6 0 0 :::3389 :::* LISTEN 11075/xrdp

Connect from Windows Client
Open Remote Desktop Connection on Windows (Win + R → mstsc → Enter).

Enter the IP address of your Ubuntu system and click Connect.


Login using your username & Password



Now, you have successfully accessed the Ubuntu GUI using XRDP.

Leave a Reply

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