As you know, most Windows servers use the RDP service for graphical connection. But in Linux, various services can be used for graphical connection, one of which is the XRDP service. You can connect to your desired Linux distribution via Windows using the Remote Desktop, but before that, you need to install a graphical environment on your Linux. That’s why we want to teach you How to Install Xrdp on Ubuntu 21.04, Ubuntu 20.04 in this article. You can visit the packages available in Eldernode if you wish to purchase an Ubuntu VPS server.
Tutorial Install Xrdp on Ubuntu 21.04 | Ubuntu 20.04
Using Xrdp, you will be able to make remote desktop connections to your device. In the next part of this article, we want to introduce you to Xrdp and some of its features. Then in the next section, after getting acquainted with Xrdp, we will teach you how to install it on Ubuntu 21.04. In the next step, we will configure Xrdp and finally explain how to connect to the Ubuntu server using Xrdp. Please stay tuned for the rest of this article.
Introduction to Xrdp and its Features
It must have happened to you that you want to access your Linux desktop screen remotely from your Windows system in a network environment. As you know, unlike Windows, Linux does not support RDP by default, but fortunately, a tool called Xrdp makes this possible on Linux as well.
The Xrdp project is an open-source tool that allows users to access their Linux desktop from within the Windows operating system. In addition to supporting Windows RDP clients, this tool also supports other similar clients such as FreeRDP, Rdesktop, NeutrinoRDP.
The new version of the program also supports TLS for added security. As Windows-to-Windows Remote Desktop can, Xrdp supports not only graphics remoting but also:
_ Two-way clipboard transfer (text, bitmap, file)
_ Audio redirection
_ Drive redirection (mount local client drives on a remote machine)
_ RDP transport is encrypted using TLS by default.
Install Xrdp on Ubuntu 21.04 | Ubuntu 20.10
In this section, we are going to teach you to step by step installing the Xrdp on Ubuntu 21.04. To do this, just follow the steps below. The first step is to update Ubuntu using the following commands:
sudo apt update
sudo apt upgrade
Since Xrdp is available in the Ubuntu package repository, just run the following command to install Xrdp:
sudo apt install xrdp gnome-tweak-tool
Note that the Xrdp service often uses a certificate stored in the /etc/ssl/ directory called ssl-cert-snakeoil.key. The Xrdp user may have access to these files. So you have to add this user to the ssl-cert group using the following command:
sudo usermod -a -G ssl-cert xrdp
How to Configure Xrdp on Ubuntu 21.04
Now we want to show you how to Configure Xrdp on Ubuntu 21.04. Before starting the configuration we have to tell you that you may encounter a black screen when using Xrdp which will prevent you from doing anything on the system. So here we need to modify the script that Xrdp uses to run the window manager. To do this, you need to open the configuration file using the text editor you want. As you can see in the following command, we use the nano editor:
sudo nano /etc/xrdp/startwm.sh
After opening the file, you should look for the following command:
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
Now you need to add the following commands to the bottom of the above command:
Finally, you can save the file by pressing CTRL+X and then Y, followed by the ENTER key.
How to Connect to Ubuntu Xrdp
In this section, we are going to show you how to connect to ubuntu Xrdp using the Windows Remote Desktop. So first open Remote Desktop Connection on your Windows. Then you need to enter the IP address of the Ubuntu server and click on Connect:
If you think the information shown is correct by looking at the image below, click the “Yes” button to confirm the connection:
After successfully completing the above steps, you can now see the Xrdp interface. After entering the username and password, you can click on the “OK” button to log in:
You will see that you are successfully logged in to the Ubuntu system:
You can check the Xrdp status on Ubuntu using the following command:
sudo systemctl status xrdp
As you learned during this tutorial, by installing Xrdp on Ubuntu, users can access the operating system using the Microsoft Remote Desktop Client. In this article, we tried to teach you How to Install Xrdp on Ubuntu 21.04. You can refer to How to install Xrdp on centos 7 and Debian if you wish.