Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Xrdp on Ubuntu 20.04 - DesignLinux

Jan 22 2021
designlinux 0 Comments

Xrdp is an open-source equivalent of Microsoft’s Remote Desktop Protocol (RDP). With xrdp installed on a Linux system, users can remotely access the Linux desktop using an RDP client as we shall demonstrate later in this article. It’s completely free to download and use.

Without much further ado, let’s see how you can install Xrdp on Ubuntu Desktop 20.04 and 18.04.

Prerequisites

This guide assumes that you already have a copy of the Ubuntu 20.04 or Ubuntu 18.04 desktop already installed. If you have a minimal installation – without a GUI – then installing a desktop environment (such as GNOME) is recommended.

To install the Ubuntu desktop environment, run the command:

$ sudo apt install ubuntu-desktop

Step 1: Install Xrdp on Ubuntu 20.04

To start off, launch your terminal and invoke the following command to install Xrdp on your system.

$ sudo apt install xrdp

When prompted, just hit 'Y' and press enter to continue with the installation.

Install Xrdp on Ubuntu
Install Xrdp on Ubuntu

Xrdp service starts automatically upon installation. You can verify this by running the command:

$ sudo systemctl status xrdp
Verify Xrdp Status on Ubuntu
Verify Xrdp Status on Ubuntu

The output confirms, without a doubt, that the xrdp daemon is active and running.

Step 2: Configure Xrdp on Ubuntu 20.04

When Xrdp is installed, an SSL certificate key – ssl-cert-snakeoil.key – is placed in the /etc/ssl/private/ folder. We need to add the xrdp user to the ssl-cert group to make the file readable to the user.

$ sudo adduser xrdp ssl-cert
Add Xrdp User to SSL Cert Group
Add Xrdp User to SSL Cert Group

Xrdp listens on port 3389 and if you are behind a UFW firewall, you need to open the port to allow inbound traffic from an RDP client. In this example, I will allow traffic from my entire subnet to the Ubuntu system.

$ sudo ufw allow from 192.168.2.0/24 to any port 3389

Thereafter, reload the firewall and confirm if the port has been opened.

$ sudo ufw reload
$ sudo ufw status
Open Xrdp Port on Ubuntu Firewall
Open Xrdp Port on Ubuntu Firewall

Step 3: Access Remote Ubuntu Desktop with RDP Client

In this step, we are going to access the Ubuntu desktop system from Windows 10 using the Remote Desktop Client. But before we do so, ensure that you first log out of Ubuntu 20.04. This because Xrdp only supports one Xsession.

Next, launch your client and key in your remote system’s IP address, and click the ‘Connect’ button.

Connect Remote Ubuntu System with RDP
Connect Remote Ubuntu System with RDP

On the pop-up that requires you to verify the identity of your remote system, ignore the certificate errors and click on the ‘Next’ button to proceed with the connection.

Verify Identity of Remote Ubuntu System
Verify Identity of Remote Ubuntu System

On the Xrdp login page, provide your login credentials and click ‘Ok’.

Enter Ubuntu Login
Enter Ubuntu Login

NOTE: At this point, you might encounter a blank black screen, instead of an Ubuntu desktop background. In fact, I personally encountered it and after some digging, I discovered a nifty workaround.

Fix Black Ubuntu Screen

The solution is quite simple. Head over to the remote system and edit the /etc/xrdp/startwm.sh script.

$ sudo vim /etc/xrdp/startwm.sh

Add these lines just before the lines that test & execute Xsession as shown in the screenshot below.

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
Fix Ubuntu Black Screen
Fix Ubuntu Black Screen

Save the file and exit. Then restart the Xrdp service.

$ sudo systemctl restart xrdp

Next, reinitiate the connection. After the initial authentication, you will be required to authenticate again as shown.

Ubuntu Login
Ubuntu Login

Provide your credentials and click ‘Authenticate’ and finally, this ushers you to the desktop screen of the remote Ubuntu desktop system as shown.

Remote Ubuntu Desktop Sharing
Remote Ubuntu Desktop Sharing

We’d love to hear your feedback and, more specifically, the challenges that you encountered. We hope that this guide was useful.

Related

Tags: Linux Desktop Sharing, Remote Linux Desktop Tools, Ubuntu Tips

5 Best Udemy Cisco Networking Courses in 2021

Prev Post

How to Install AnyDesk on Debian 10 Buster

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 2
  • 621
  • 1,055,393

DesignLinux.com © All rights reserved

Go to mobile version