How to Install Xrdp on Ubuntu 21.04 | 20.04

How to Install Xrdp on Ubuntu 21.04

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.

Video 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.

Recommended Article: Configure Mosh Shell as SSH Alternative on Ubuntu 20.04

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/

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:


Remote Desktop


If you think the information shown is correct by looking at the image below, click the “Yes” button to confirm the connection:


remote desktop certificate


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:


xrdp login to ubuntu 21.04


Note that if you can’t log in to the XRDP environment, you should check your Gnome status. If Gnome isn’t installed on your Ubuntu system, you can install it with the following command:

sudo apt install gnome-session gdm3

You will see that you are successfully logged in to the Ubuntu system:


Connect to Ubuntu System using xrdp


You can check the Xrdp status on Ubuntu using the following command:

sudo systemctl status xrdp
Recommended Article: Set date and time on Ubuntu 18


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.

How useful was this post?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

One thought on “How to Install Xrdp on Ubuntu 21.04 | 20.04

  1. Thanks for the information!

    The instructions about modifying the configuration says “Now you need to add the following commands to the bottom of the above command:”.

    Do you mean “below” the command? I.e. on the line before the exec?

    It would be clearer with a screenshot of the configuration file, after the applied fixes.

    It would also be nice with links to the relevant bug-reports.

Leave a Reply

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

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way


7 days a week, 24 hours a day