The remote desktop is one of the best ways we have to provide remote technical support. That’s why there are implementations that allow you to do it on Linux. So in this post, you will learn how to install Xrdp (remote desktop) on Ubuntu 20.04 no matter what desktop environment you are using.
Xrdp – Remote Desktop Protocol for Linux Servers
First things first, what is xrdp? Well, very briefly, Xrdp is an implementation of Microsoft’s RDP (Remote Desktop Protocol), for Linux servers.
At this point, you might think, remote desktop on a server? Well, not only applies to servers but also any computer with Ubuntu 20.04. Although it is also true that many new users start on servers with a basic and lightweight desktop environment such as LXDE or XFCE.
Anyway, thanks to this adaptation we can connect to Linux servers using the Windows Remote Desktop client. So it can be useful at any time of work, or to receive technical support from another computer that has Microsoft Windows.
Some features are:
- Connect to a Linux desktop using RDP from anywhere (requires xorgxrdp Xorg module)
- Reconnect to an existing session
- Session resizing
- RDP/VNC proxy (connect to another RDP/VNC server via xrdp)
Finally, it is important to say that RDP transport is encrypted using TLS by default. Therefore also with Xrdp we will have secure sessions.
Installing Xrdp on Ubuntu 20.04
The xrdp package is hosted in the Ubuntu universe repository so you have to verify that it is enabled.
You can verify this from terminal running:
sudo nano /etc/apt/source.list
And you will see a line similar to this one:
deb http://archive.ubuntu.com/ubuntu focal main restricted
If after restricted the words multiverse and universe appear, then they are added to the list of software, if not add them to make it look like this:
deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
Save the changes, if any, and close the editor.
So, update APT:
sudo apt update
And now yes, install the package xrdp by running the following command:
sudo apt install xrdp
And when installed, you can talk it into running at boot time with the following command:
sudo systemctl enable xrdp
sudo systemctl start xrdp
Now check out the operation of the service
sudo systemctl status xrdp
If all is well, we can continue without problems.
Configuring xrdp for the first use
Before leaving xrdp ready for the task, there are a few things to do.
The first thing to do is to create a new user to make the connection. This is done because it is not recommended to do it with the root user.
sudo useadd xrdpuser -G sudo
And assign a password:
sudo passwd xrdpuser
With the user created, the next step is to open the xrdp port in the firewall:
sudo ufw allow 3389
With this, you will be ready xrdp but optionally you can increase the performance by making some adjustments. Again, this is optional.
The xrdp configuration file is in the path
/etc/xrdp/ and is called
xrdp.ini and in it, you can change some things like the port, but also some options that increase the performance of it.
So, create a backup of the file:
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
And now edit it:
sudo nano /etc/xrdp/xrdp.ini
Inside the file changes the value of the following parameters, leaving them as follows:
And add this one:
use_compression parameter must be after
Save the changes, and close the file.
Apply the changes by restarting the xrdp service.
sudo systemctl restart xrdp
And that’s it, now you have xrdp correctly configured and ready to accept connections from clients with Microsoft Windows.
Having Xrdp in a system with Ubuntu 20.04 can be life saver that allows us to solve many problems. Above all, because many people use Microsoft Windows and not Ubuntu, then with Xrdp we can get or give technical support through remote desktop.
Tell us, did you know about Xrdp? do you have it? leave us a comment and help us by sharing this post.