XRDP is a software that lets you use Remote Desktop Protocol (RDP) to connect to a computer. It runs on Linux and uses a DisplayLink device. The connection between the client and the server is secure with TLS encryption.
XRDP is simple to set up and customize on Ubuntu. You can also use a VNC server to access your Ubuntu remote desktop. Check out this tutorial on installing a VNC server on Ubuntu.
In this guide, we will show you how to install and set up XRDP on Ubuntu 24.04 and 22.04. We will also cover some common configuration tasks.
How To Install XRDP on Ubuntu: Step-by-Step
You need to have a Desktop Environment (X server) installed and running on your server. Additionally, you need to install the xrdp (X Remote Desktop Protocol) client software on your client computer.
Step 1 – Installing XRDP on Ubuntu
The installation of XRDP on Ubuntu is straightforward. The package is available in the official repositories, so we can simply install it with the apt package manager.
sudo apt update
sudo apt install xrdp -y
Once the installation is successfully finished, the XRDP service will be started automatically. You can check the status by executing the following command:
sudo systemctl status xrdp
The above output shows the Xrdp service is up and running.
Step 2: Configuring XRDP
The installer will create a new account named “xrdp”. The xrdp session uses a certificate key file “/etc/ssl/private/ssl-cert-snakeoil.key”, which plays an important role with remote desktops.
In order to work it properly, add the xrdp user to the “ssl-cert” group with the following command.
sudo usermod -a -G ssl-cert xrdp
Restart the Xrdp service by running the command given below:
sudo systemctl restart xrdp
Step 3: Configure System Firewall
The XRDP service listens on standard remote desktop port 3389. You need to adjust the firewall to allow access to port 3389 for the remote systems.
Systems running with a UFW firewall, use the following command to open port 3389 for the LAN network.
sudo ufw allow from 192.168.1.0/24 to any port 3389
Reload the UFW to apply the new rules.
sudo ufw reload
All right, Your system is ready to access over RDP protocol.
Step 4: Connect to Remote Desktop
The Xrdp service is successfully installed and ready to connect. On your Windows client, open the RDP client and enter the IP address of the Ubuntu system.
On the Windows system launch the RDP client:
Once connected successfully, the remote system prompt for authentication. Enter the login credentials of the remote Ubuntu system to get remote desktop access.
On successful authentication, you’ll get access to Ubuntu remote desktop.
Now, you can manage your remote Ubuntu system graphically.
Conclusion
In conclusion, setting up XRDP on your Ubuntu system allows for a secure and efficient remote desktop connection using the Remote Desktop Protocol. By following this guide, you can easily install and configure XRDP on both Ubuntu 24.04 and 22.04. Make sure you have a Desktop Environment running on your server and the xrdp client software on your client computer. For those who prefer using a VNC server, you can also find a helpful tutorial to set it up on Ubuntu. With these tools, accessing and managing your Ubuntu desktop remotely becomes straightforward and convenient.
14 Comments
sudo apt install xrdp -y
command does not work
try
sudo apt install xrdp
Normal, there is a space, if you didn’t copy the space also, it won’t work.
192.168.1.0 from Step 3 represent the ip address of linux machine?
Thank a lot. When you finally install the xrdp and configure the FW, a reboot is a good idea for ensure that services are working OK and RDP connection work properly.
On Xubuntu 22.10, after username and password, the screen goes black and session closes. looking at the status xrdp command, it shows I connect and no errors… ;( Any direction on this?
same problem
Same for me!!!!
Do you have a guide to generate and replace the invalid SSL certificate that the Ubuntu server generates? It just says localhost@localhost. I would love to generate and replace that SSL cert with an updated self-signed one.
Works great; thanks a lot!
All that I get is a black screen with a cursor after connecting. Is something not set up correctly?
I figured it out… simple fix — log out of my account before connecting via RDC. Easy Peasy — thanks!
Ooops… I was doing the same thing thinking I could take over the session.
Youre the man!
thanks a lot!