2 minutes read

How to install Remote Desktop Service on the Ubuntu OS

In a scenario where we need to have GUI access on our remote server, it is good to have this cheat sheet in hand. What we will run through in this article is how to install remote desktop service on the Ubuntu machine. Remote desktop we'll install and configure is XRDP. Let's check out the steps!

Specification:

OS Version: Ubuntu 20.04 (LTS) x64

For XRDP to serve a GUI we need to have one. We'll go ahead and install GNOME because it is a preferred environment for us, doesn't have to be for you ๐Ÿ˜.

  • update OS, if not already:
$ sudo apt update
  • Install XFCE packages:
$ sudo apt-get install gnome-session gdm3

Now, let's install the XRDP:

$ sudo apt-get install xrdp

Cool! We have installed the XRDP service! Now, if you are running a firewall (ufw service) on your machine, you need to make sure that it's accessible on port 3389:

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

Connecting to XRDP (Remote Desktop)

We will be using the Microsoft Remote Desktop app available on our local test machine running macOS. Note that there are many other options for good RDP software, this one I find appealing at the moment ๐Ÿ˜.

Open the app (after you install it from App store) and choose the option "Add PC". The following dialog opens and you are required to enter the IP address of the server running XRDP service (where we used example 12.13.14.15); the rest of the settings are left as below:

Microsoft Remote Desktop App | Add PC dialog
Microsoft Remote Desktop App | Add PC dialog

Note that we have the "User account" option left on "Ask when required". We'll leave it like this so that we don't keep sensitive login details stored within the app. When this setting is saved you can see the server in the list as follows:

Microsoft Remote Desktop App | List servers
Microsoft Remote Desktop App | List servers

Alright! Now, double click on the available server in the list opens the login dialog. This happens because we left the "User Account" option on "Ask when required":

Microsoft Remote Desktop App | Login form
Microsoft Remote Desktop App | Login form

Feel free to continue through following warning:

Microsoft Remote Desktop App | Certificate Warning
Microsoft Remote Desktop App | Certificate Warning

Almost done! Next window will be actual remote desktop powered by GNOME environment:

Microsoft Remote Desktop App | Remote GNOME environment

That's it! We have successfully established a remote desktop connection to our Ubuntu server.