Installing xRDP (Remote Desktop) on Ubuntu Server

PowerADM.com / Linux / Ubuntu / Installing xRDP (Remote Desktop) on Ubuntu Server

In this article, we’ll take a look at how to enable Remote Desktop access to Ubuntu Server using xRDP.

XRDP allows you to remotely connect to the graphical desktop of computers using the Microsoft Remote Desktop Protocol (RDP). XRDP accepts connections from various RDP clients: FreeRDP, RDesktop, NeutrinoRDP, and Microsoft Remote Desktop Client (for Windows, macOS, iOS, and Android).

Typically, Linux servers don’t have a graphical desktop interface. Therefore, you first need to install X11 and a lightweight desktop environment that will act as the engine for xRDP.

There are several desktop environments in the Ubuntu repository. In our case, we will be using Xfce. It is a fast, stable, and lightweight desktop environment for Linux.

Update packages to the latest version:

sudo apt update && apt -y dist-upgrade

Install Xfce:

sudo apt -y install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

Install xRDP:

sudo apt -y install xrdp

Check that the xRDP daemon is installed and running:

sudo systemctl status xrdp

run xrdp on ubuntu server

Add your user to the SSL-CERT group:

sudo adduser xrdp ssl-cert
By default, xRDP uses the /etc/ssl/private/ssl-cert-snakeoil.key file, which is readable only by members of the SSL-CERT group.

The xRDP settings are specified in the xrdp.ini configuration file:

sudo nano /etc/xrdp/xrdp.ini

Add the following line to the end of the file:

exec startxfce4

And restart XRDP:

sudo systemctl restart xrdp

Remember to open port 3389 in the Linux firewall. The following command allows RDP connections to the server from the specified network:

sudo ufw allow from 192.168.1.0/24 to any port 3389
4 thoughts on “Installing xRDP (Remote Desktop) on Ubuntu Server”
  1. successfully connect remote desktop but find blank screen. I have issue this sudo ufw allow from 192.168.1.240/24 to any port 3389. Is it correct then what i miss? please guide.

    1. Check if the account you are using to login via the RDP client is not currently logged on locally on the Ubuntu target host. Perform a logout operation

Leave a Reply to Muhammad Khalil Cancel reply

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