Skip to main content

How to Install Remote Desktop (xrdp) on Ubuntu

In this guide, we will explain how to install Remote Desktop Protocol using xrdp on an Ubuntu instance, enabling seamless remote access to your system for enhanced productivity.


Install xRDP on Ubuntu

XRDP: Remote Desktop Protocol Server for Unix-like Systems

xRDP is an open-source server application that allows you to utilize Microsoft's Remote Desktop Protocol (RDP) on operating systems aside from Windows, including Linux and BSD variants. This enables seamless remote desktop access between Windows clients and non-Windows servers, offering a cohesive environment for mixed-OS networks.

xRDP allows users to connect to a Linux machine from another computer using a compatible RDP client.


Steps to Install xRDP on Ubuntu

1. Update Ubuntu Server

First, update and upgrade the system:

sudo apt-get update -y && sudo apt-get upgrade -y  

2. Install Graphical Interface and xRDP

  1. Install the graphical interface:
   sudo apt-get install xubuntu-desktop -y  
  1. Install xRDP:
   sudo apt-get install xrdp -y  

3. Check Status, Start, and Enable xRDP

  1. Check the status of the xRDP service:
   systemctl status xrdp  

  1. Start and enable the xRDP service:
   sudo systemctl start xrdp  
sudo systemctl enable xrdp  

4. Add xRDP User to SSL-Cert Group

Add the xRDP user to the ssl-cert group:

sudo usermod -a -G ssl-cert xrdp  

Restart the xRDP service:

sudo systemctl restart xrdp  

5. Configure Firewall

Allow RDP traffic through the firewall:

sudo ufw allow 3389/tcp  

Check the UFW status, enable it, and reload the rules:

sudo ufw status  
sudo ufw enable  
sudo ufw reload  


Connect to Remote Desktop

Use an RDP client to connect to your Ubuntu server. Enter your Ubuntu server's IP address, username, and password.


Troubleshooting

If you encounter issues after entering your username and password, follow these steps:

  1. Stop the xRDP service:
   sudo service xrdp stop  
  1. Edit the startwm.sh file:
   sudo vi /etc/xrdp/startwm.sh  

Comment out the following line by adding a # at the beginning:

# test -x /etc/X11/Xsession && exec /etc/X11/Xsession  
exec /bin/sh /etc/X11/Xsession  

Add this line instead:

startxfce4  

  1. Start the xRDP service again:
   sudo service xrdp start