How to Install XRDP on Ubuntu 20.04/22.04

Learn step-by-step how to install XRDP on Ubuntu 20.04 and Ubuntu 22.04 servers. This guide is beginner-friendly and explains how to set up Ubuntu Remote Desktop with XRDP so you can connect using RDP from Windows or Mac.

Introduction

If you want to connect to your Ubuntu server using Remote Desktop Protocol (RDP), the best way is to set up XRDP on Ubuntu. This guide will walk you through the complete process of installing XRDP on Ubuntu 20.04 and 22.04, enabling RDP, and fixing common issues like the blue screen, black screen, and authentication required errors.

Whether you are new to Linux or just setting up your first Ubuntu remote desktop XRDP, don’t worry — this tutorial is written in simple steps for beginners.

How to Install XRDP on Ubuntu?

Step 1: Log into Ubuntu Server

First, connect to your Ubuntu server via SSH: How to SSH to Linux Server Remotely

Step 2: Install Ubuntu Desktop Environment

Since Ubuntu Server does not come with a GUI, you need to install the Ubuntu desktop environment.

sudo apt update
sudo apt install ubuntu-desktop

install ubuntu desktop environment
install ubuntu desktop environment

This will take a while since it installs the full desktop environment.

Step 3: Install XRDP on Ubuntu

Now install XRDP:

sudo apt install xrdp

install xrdp

This completes the basic Ubuntu XRDP install.
install xrdp

This completes the basic Ubuntu XRDP install.

Step 4. Open Firewall Port 3389

Allow RDP traffic through the firewall:

sudo ufw allow 3389/tcp

open port

Step 5. Test XRDP Connection

On your Windows PC:

  1. Press Win+R → type mstsc → press Enter.
  2. Enter your server IP or hostname.
  3. Log in with your Ubuntu username and password.
    test connection
    test connection
    test connection

Now you should be connected to your Ubuntu Remote Desktop XRDP session.

Step 6. Done! Connect to Ubuntu via RDP

Congratulations! You have successfully set up XRDP on Ubuntu 20.04 and 22.04. You can now use RDP to access your Ubuntu desktop remotely from any Windows or Mac computer.

XRDP Connection Issues and Solutions

1. Fix XRDP Blue Screen Issue

If you get a blue screen after login:

sudo apt-get install xorgxrdp
sudo systemctl restart xrdp

blue screen

2. Fix XRDP Black Screen Issue

If you see a black screen instead of the desktop:

  1. Open the XRDP startup file:
sudo -i
sudo vim /etc/xrdp/startwm.sh
  1. Add these lines at the top:
unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
. $HOME/.profile
  1. Restart XRDP service:
sudo systemctl restart xrdp

black screen

3. Fix XRDP “Authentication Required” Error

issues

If you can’t log in and see the Authentication Required message:

  1. Edit the XRDP config file:
sudo vi /etc/xrdp/sesman.ini
  1. Under[Xvnc], add these two lines:
param8=-SecurityTypes
param9=None
  1. Restart XRDP:
sudo systemctl restart xrdp

issues

Conclusion

Setting up XRDP Ubuntu is the easiest way to get a remote desktop environment on your server. Whether you are using Ubuntu 20.04 XRDP or Ubuntu 22.04 XRDP, the steps are the same.

By following this guide, you now know how to:

  1. Install XRDP on Ubuntu
  2. Enable RDP on the Ubuntu server
  3. Fix XRDP blue screen, black screen, and authentication errors
  4. This makes Linux XRDP setup simple and beginner-friendly.
Keywords:

xrdp ubuntu, install xrdp ubuntu, ubuntu install xrdp, install rdp on ubuntu, install xrdp on ubuntu, install xrdp ubuntu 22.04, xrdp ubuntu 22.04, ubuntu 22.04 xrdp, ubuntu xrdp install, xrdp install ubuntu 22.04, ubuntu server xrdp, xrdp ubuntu 20.04, install xrdp ubuntu 20.04, ubuntu 20.04 xrdp, ubuntu remote desktop xrdp, xrdp ubuntu desktop, linux xrdp setup, linux xrdp

Outline