How to Connect to Ubuntu 20.04 Server using Remote Desktop

Prerequisites:

Update your server to the latest,

apt-get update
apt-get upgrade

Install Xrdp

Installing Xrdp is easy and requires just 1 command line,

apt install xrdp

Output:

root@vps:~# apt install xrdp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  xorgxrdp
Suggested packages:
  guacamole xrdp-pulseaudio-installer
The following NEW packages will be installed:
  xorgxrdp xrdp
0 upgraded, 2 newly installed, 0 to remove and 45 not upgraded.
Need to get 488 kB of archives.
After this operation, 3,212 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

Start the Xrdp service and enable Xrdp to start up during boot, use the commands below.

systemctl start xrdp
systemctl enable xrdp

Output:

root@vps:~# systemctl enable xrdp
Synchronizing state of xrdp.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable xrdp

Next, add the user xrdp in to the ssl-cert group with the below command,

adduser xrdp ssl-cert

and restart the xrdp service,

systemctl restart xrdp

To check Xrdp status using the command below.

systemctl status xrdp

Output:

root@vps:~# systemctl status xrdp
● xrdp.service - xrdp daemon
     Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: >
     Active: active (running) since Fri 2020-05-08 20:48:58 UTC; 1min 17s ago
       Docs: man:xrdp(8)
             man:xrdp.ini(5)
   Main PID: 45020 (xrdp)
      Tasks: 1 (limit: 1074)
     Memory: 1.1M
     CGroup: /system.slice/xrdp.service
             └─45020 /usr/sbin/xrdp

Firewall

RDP client connects to your server via port 3389, you will need to allow this in firewall with below command,

ufw allow 3389

Connect via Windows RDP client

Open Remote Desktop Connection (RDP) client software on your Windows system, login to the Ubuntu server using the IP address or domain it is configured with.

images

Enter the username and password to connect using Xorg.

images

GUI welcome page will appear and you can access the ubuntu server.

images