How To Enable RDP Using XRDP on Ubuntu

Remote Desktop Protocol (RDP) allows you to connect to the graphical interface of another computer remotely. This can be invaluable for tasks such as server administration, accessing files on a remote machine, or getting technical assistance.

In this guide, we will show you how to install and configure xRDP, an open-source RDP implementation for X11, to enable remote access on your Ubuntu system.

PRODUCTS THAT MIGHT INTEREST YOU:

Benefit from the best server plans and related services, competitive prices, coupled with personalized attention to each client. Supported by top-notch technical assistance that remains consistently accessible to address all your inquiries.

Prerequisites

  • An Ubuntu system
  • An internet connection
  • A user account with sudo privileges

Step 1: Install a Desktop Environment

RDP connections require a graphical desktop environment. If you don’t already have one, you can install the Xfce desktop environment by running the following command in your terminal:

sudo apt install xfce4 xfce4-goodies -y

Step 2: Install xRDP

xRDP is the RDP server software. Install it using this command:

sudo apt install xrdp -y

Check the status of the xRDP service to ensure it is running:

sudo systemctl status xrdp

If the xRDP service is not running, start it using this command:

sudo systemctl start xrdp

Step 3: Configure xRDP

Open the xRDP configuration file /etc/xrdp/xrdp.ini with a text editor. For example, you can use vim:

sudo vim /etc/xrdp/xrdp.ini

Locate and edit the following lines to ensure they are set as shown:

[RDP]

SecurityLayer=Negotiate
Port=3389

[Xorg]

EnableReflection=true

Save the changes and close the editor. Restart the xRDP service to apply the changes:

sudo systemctl restart xrdp

Step 4: Configure the System Firewall

First, find out your public IP address by running:

curl ifconfig.me

Opening firewall ports introduces security risks. It’s recommended only to enable RDP on trusted networks. To allow RDP traffic, run this command, replacing [your_public_ip] with your actual public IP address:

sudo ufw allow from [your_public_ip]/32 to any port 3389

Check the status of your firewall to ensure the rule is applied:

sudo ufw status

Step 5: Enable the xRDP Service to Start on Boot

Ensure that the xRDP service starts automatically at boot with this command:

sudo systemctl enable xrdp

Step 6: Test the RDP Connection

Use the Remote Desktop Connection application from another computer on your network to test the RDP connection. Then, enter the IP address of your Ubuntu system and login using your Ubuntu user account credentials.

Additional Notes

Using Wayland?

If you’re using a Wayland session, install the xorg-session-start-wayland package and make additional configuration changes. Refer to the xRDP documentation for details.

Alternative: Secure Remote Access with SSH

Consider using SSH for a more secure alternative to RDP. Guides on setting up SSH remote access for Ubuntu are available online.

Conclusion

Following these steps, you’ve successfully enabled RDP on your Ubuntu system using xRDP. Remember to prioritize security by only enabling RDP on trusted networks and using strong passwords. Remote access can significantly enhance your ability to manage and troubleshoot your systems, but always stay vigilant about security.

HAVE A QUESTION OR WANT TO GET A CUSTOM SOLUTION?

CONTACT SALES

FAQs

RDP (Remote Desktop Protocol) allows you to remotely connect to the graphical interface of another computer. It is useful for server administration, accessing remote files, or getting technical assistance.

xRDP is an open-source RDP implementation for X11 that enables remote desktop access to Linux systems.

An Ubuntu system, an internet connection, and a user account with sudo privileges.

sudo apt install xfce4 xfce4-goodies -y

sudo apt install xrdp -y

sudo systemctl status xrdp

The file /etc/xrdp/xrdp.ini needs to be edited.

Set ‘SecurityLayer=Negotiate’ and ‘Port=3389’ under [RDP], and ‘EnableReflection=true’ under [Xorg].

sudo systemctl restart xrdp

By running the command ‘curl ifconfig.me’.

sudo ufw allow from [your_public_ip]/32 to any port 3389

sudo systemctl enable xrdp

Use the Remote Desktop Connection application, enter the IP address of your Ubuntu system, and log in with your Ubuntu user credentials.

Install the xorg-session-start-wayland package and make the necessary configuration changes as per the xRDP documentation.

Using SSH is an alternative for secure remote access to Ubuntu systems.