Jul 11, 2023 5 min read

How to Install Xrdp Server (Remote Desktop) on Ubuntu 22.04

Install Xrdp Server on Ubuntu 22.04 with our step-by-step tutorial. It enables remote access and control of a system from another device.

Install Xrdp Server (Remote Desktop) on Ubuntu 22.04
Table of Contents

Introduction

Before we begin talking about how to install Xrdp Server (Remote Desktop) on Ubuntu 22.04, let's briefly understand – What is Xrdp Server (Remote Desktop)?

Xrdp Server, also known as Remote Desktop, is a powerful software that enables remote access and control of a computer from another device. It allows users to connect to their computer remotely and interact with it as if they were physically present.

Xrdp Server provides a secure and convenient way to access files, run applications, and perform tasks on a remote computer, making it an ideal solution for businesses and individuals needing remote access capabilities. With Xrdp Server, you can easily connect to your computer from anywhere, increasing productivity and efficiency.

In this tutorial, you will install Xrdp Server (Remote Desktop) on Ubuntu 22.04. We will also address a few FAQs on how to install Xrdp Server on Ubuntu 22.04.

Advantages of Xrdp Server (Remote Desktop)

  1. Remote Access: Xrdp Server allows users to remotely access their computer from anywhere, providing flexibility and convenience.
  2. File Sharing: With Xrdp Server, users can easily share and transfer files between their local and remote computers.
  3. Application Execution: Users can run applications on their remote computer through Xrdp Server, boosting productivity and efficiency.
  4. Multi-Platform Support: Xrdp Server is compatible with various operating systems, including Windows, Linux, and macOS.
  5. Secure Connection: Xrdp Server ensures a secure connection by implementing encryption protocols, protecting sensitive data during remote sessions.

Installing Desktop Environment

Ubuntu servers are controlled from the command line and do not come pre-installed with a desktop environment. If you use Ubuntu on your desktop, you may skip this step.

The Ubuntu repositories contain a variety of desktop environments from which you can choose. One choice is to install Gnome, which is the default desktop environment in Ubuntu 22.04. Another alternative is to install Xfce. It is ideal for usage on a remote server because of its fast, stable, and lightweight desktop environment.

Execute one of the following commands to install the desktop environment of your choice.

  • Install Gnome:
  • Install Xfce:
sudo apt update
sudo apt install ubuntu-desktop
sudo apt update
sudo apt install xubuntu-desktop

It may take some time to download and install GUI packages, depending on your system.

Installing Xrdp

Xrdp is available in the Ubuntu default repositories. Run the command shown below to install it:

sudo apt install xrdp 

Following installation, the xrdp service will start automatically. You can check it by typing:

sudo systemctl status xrdp

The output should look as shown below:

Output
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-05-22 17:36:16 UTC; 4min 41s ago
  ...

By default, Xrdp uses the //etc/ssl/private/ssl-cert-snakeoil.key file, which is only accessible to members of the “SSL-cert” group. To add the xrdp user to the group, run the following command:

sudo adduser xrdp ssl-cert  

In order for changes to take effect, restart the Xrdp service:

sudo systemctl restart xrdp

There you go. Xrdp has been installed on your Ubuntu server and is ready for use.

Xrdp Configuration

The directory /etc/xrdp contains the Xrdp configuration files. You do not need to modify the configuration files for simple Xrdp connections.

Xrdp uses the default X Window desktop environment (Gnome or XFCE).

xrdp.ini is the main configuration file. This file is divided into sections and lets you set global configuration settings such as security and listening addresses, as well as create separate Xrdp login sessions.

You must restart the Xrdp service after making any configuration file changes.

To start an X session, Xrdp uses the startwm.sh file. Edit this file if you want to use a different X Window desktop.

Configuring Firewall

On all interfaces, the Xrdp daemon listens on port 3389. You must open the Xrdp port if your Ubuntu server is protected by a firewall.

To permit access to the Xrdp server from a specific IP address or IP range, for example, 192.168.33.0/24you would run the following command:

sudo ufw allow from 192.168.33.0/24 to any port 3389

If you wish to allow access from somewhere (which is highly discouraged for security reasons), run:

sudo ufw allow 3389

For increased safety, configure Xrdp to listen exclusively on localhost and create an SSH tunnel that securely forwards traffic from your local machine on port 3389 to the server on the same port.

Connecting to the Xrdp Server

Launch your Xrdp client and connect to it once your Xrdp server has been established.

The default RDP client is accessible if you have a Windows PC. Enter "remote" in the Windows search box and click on "Remote Desktop Connection". The RDP client will open as a result. Enter the IP address of the remote server in the "Computer" field and click "Connect".

On the login screen, enter your username and password before clicking on “OK.”

‌After logging in, you should see the default Gnome or Xfce desktop. It should resemble the following:

You can now interact with the remote desktop from your local machine using your keyboard and mouse.

The Microsoft Remote Desktop program is available for download from the Mac App Store if you are using macOS. Linux users have access to RDP clients like Remmina or Vinagre.

FAQs to Install Xrdp Server (Remote Desktop) on Ubuntu 22.04

Are there any prerequisites for installing Xrdp Server on Ubuntu 22.04?

Yes, make sure your Ubuntu system is up-to-date by running sudo apt update and sudo apt upgrade before installing Xrdp Server.

Can I connect to an Ubuntu 22.04 machine using Xrdp Server from a Windows computer?

Yes, Xrdp Server allows connections from various platforms, including Windows, so you can remotely access an Ubuntu 22.04 machine.

Are there any firewall settings to consider for Xrdp Server on Ubuntu 22.04?

Yes, ensure that the firewall allows incoming connections on port 3389, which is used by Xrdp Server for remote desktop access.

How can I configure Xrdp Server after installation on Ubuntu 22.04?

You can modify the Xrdp Server configuration file located at /etc/xrdp/xrdp.ini to customize settings such as resolution, session types, etc.

Can I use Xrdp Server with multiple users on Ubuntu 22.04?

Yes, Xrdp Server supports multiple user sessions, allowing multiple users to connect and use the remote desktop simultaneously.

Does Xrdp Server support clipboard sharing between local and remote machines on Ubuntu 22.04?

Yes, Xrdp Server supports clipboard sharing, allowing you to copy and paste text or files between your local and remote machines.

Can I use Xrdp Server for remote printing on Ubuntu 22.04?

Yes, Xrdp Server has built-in support for remote printing, enabling you to print documents from your remote session to a local printer.

Conclusion

By setting up a remote desktop, you can control your Ubuntu 22.04 server from a local system using a simple graphic interface.

If you have any suggestions or queries, kindly leave them in the comments section.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Blog - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.