Jump toUpdate content
Deploying a remote desktop with XRDP on Ubuntu Jammy Jellyfish (22.04 LTS)
Remote Desktop - Overview
Instances can be used with third party software to run a remote desktop. The software captures the Instance’s screen and transmits it to another device, where the user can interact with the remote machine using its local keyboard and mouse.
A remote desktop can be useful for tasks such as:
- accessing a remote computer from anywhere
- editing and sharing files between other machines using a high-speed Internet connection
- performing administrative tasks
- performing live demonstrations of applications installed on the remote machine
In this tutorial you learn how to deploy a remote desktop on an Instance running on Ubuntu Jammy Jellyfish (22.04 LTS) by using the following stack:
- xRDP - an open-source alternative to Microsoft RDP (Microsoft Remote Desktop Protocol).
- xfce - a lightweight and stable desktop environment
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console
- You have configured your SSH Key
- You have an Instance running on Ubuntu Jammy Jellyfish (22.04 LTS)
- You have sudo privileges or access to the root user
Preparing the remote machine
- Connect to your Instance using
- Update the
aptsources list and upgrade the software already installed on the Instance:apt update && apt upgrade -y
- Install the required packages for the desktop environment using the
aptpackage manager:The xRDP server binary is available in the default Ubuntu repositories and it can be installed usingapt install xorg xfce4 xfce4-goodies dbus-x11 x11-xserver-utils
- Run the following command installs the packages
ufw, a firewall to protect your Instance from unauthorized access:The package manager configures the service to be automatically started upon system reboot.apt install xrdp ufw
- Run the following command to check that the service has been started during the installation:
A message like the following displays, confirming the statussystemctl status xrdp.service
active (running):In case the service has not been started automatically, start it with● xrdp.service - xrdp daemonLoaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)Active: active (running) since Fri 2022-05-06 14:40:08 UTC; 47s ago
systemctl:systemctl start xrdp.service
- Open the xRDP configuration file in a text editor of your choice, for example
- Scroll to the bottom of the file and add the following line, then save the file and exit the text editor:
- Restart the xrdp service using
systemctlto activate the new configuration:systemctl restart xrdp.service
Configuring the firewall
- Restrict the access to port
3389to an IP address or a range of IPs. To allow access from the block
192.168.1.0/24launch the following command:To allow connections from any host run the following command:ufw allow from 192.168.1.0/24 to any port 3389ufw allow 3389Important:
Exposing the service to any IP may cause a security issue.
- Enable the firewall:
For more information on how to configure your Instance’s firewall, you can read our tutorial about the configuration of ufw on Ubuntu.
Configuring a regular user
We recommend you create a regular user on your Instance, other than the root user, to connect to the remote desktop, to avoid security issues.
- Add the user with the
- Install sudo using the
aptpackage manager if you want to give superuser rights to the user. (Optional).apt install sudo
- Add the user to the sudoers file. (Optional)
adduser <myuser> sudo
Connecting to the remote desktop
- Download and install an RDP client of your choice. In this tutorial we use the Microsoft Remote Desktop Client.
- Start the RDP client and click Add Desktop to add a new connection:
- Enter the connection details. You must enter at least your Instance’s IP under PC name. Optionally, you can add a Friendly Name to facilitate the identification of your Instance in case you configure several RDP connections.
- Double click the connection icon. During the first connection, you may be asked to validate the fingerprint of the Instance. Click OK to confirm the connection.
- Enter the identifier and password of your regular user when prompted.
- You are now connected and the remote desktop of your Ubuntu Jammy Jellyfish (22.04 LTS) Instance displays. You can launch applications on the remote machine, as you would do locally.