How to Install XRDP on Ubuntu 20/22

Introduction

This is a guide on how to install XRDP with Audio Redirection on Ubuntu Server 20.04.
 
  1. Log into Ubuntu 20 Server
  2. Install ubuntu-desktop Environment
  3. Install XRDP 
  4. Open port 3389 on the firewall
  5. Test XRDP connection
  6. How to solve XRDP blue Screen
  7. How to solve XRDP black screen
  8. How to solve XRDP "Authentication Required"

1.Log into Ubuntu 20 Server

Please refer to https://portal.databasemart.com/kb/a237/how-to-ssh-to-linux-server.aspx to log into the Ubuntu server via SSH.
 
Please refer to https://portal.databasemart.com/kb/a604/how-to-access-linux-server-via-mac.aspx to log into the Ubuntu server from MAC.

2.Install ubuntu-desktop Environment 

To install the ubuntu-desktop environment, please issue the following commands in the terminal session
 
sudo apt update
sudo apt install ubuntu-desktop
 
 

3.Install XRDP

sudo apt install xrdp
 

4.Open port 3389 on the firewall

sudo ufw allow 3389/tcp

5.Test XRDP connection

Enter win+R on the keyboard and type "mstsc" to launch the Remote Desktop Connection application. Input your hostname or the server IP.
 
Input username "administrator" and the server password, then click "OK" to connect to the Ubuntu 20 server.
 
Now you are successfully logged in.
 

6. How to solve XRDP blue Screen

 If you blue screen after installing XRDP, install xorgxrdp.
sudo apt-get install xorgxrdp
sudo systemctl restart xrdp
 
 

7. How to solve XRDP black screen

(1) If you encounter an XRDP black screen, use the following command:
sudo -i
sudo vim /etc/xrdp/startwm.sh
 
(2) Configure the following 3 lines into the /etc/xrdp/startwm.sh. Please check out the pictures.
unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
.$ HOME/.profile
 
(3) Restart XRDP service
sudo systemctl restart xrdp
 

8. How to solve XRDP "Authentication Required"

 
If XRDP encounters the “Authentication Required” but fails to log in when you enter the password, edit the file /etc/xrdp/sesman.ini.
vi /etc/xrdp/sesman.ini
 
(1) Find [Xvnc].
Add two lines below the parameter.
param8=-SecurityTypes
param9=None
 
(2) Restart XRDP service
sudo systemctl restart xrdp
 

9.Done

Add Feedback