Featured image of post Adding a Desktop and Enabling Remote Desktop Login on Ubuntu Server

Adding a Desktop and Enabling Remote Desktop Login on Ubuntu Server

To install a desktop (graphical interface) and remote desktop on Ubuntu Server 20.04, follow these steps: After installation...

To install a desktop (graphical interface) and remote desktop on Ubuntu Server 20.04, you can follow these steps:

  1. Install the Desktop Environment. Open the terminal and enter the following command to install either the Gnome or Xfce desktop environment (execute one of the two):

    • To install Gnome: sudo apt update && sudo apt-get upgrade && sudo apt install ubuntu-desktop
    • To install Xfce: sudo apt update && sudo apt-get upgrade && sudo apt install xubuntu-desktop.
  2. Install Remote Desktop. Enter the following command in the terminal to install the Xrdp service:

    • To install Xrdp: sudo apt install xrdp.

After the installation is complete, the Xrdp service will start automatically. You can connect to the Ubuntu Server using the default RDP client on Windows by entering your username and password, then clicking “OK”.

If you’re using Ubuntu 20 or a later version, you may experience a crash when attempting to connect, so an additional configuration step is necessary.

On Ubuntu 20, you need to grant the xrdp user permission to access certificates:

1
sudo adduser xrdp ssl-cert

You also need to specify which desktop environment xrdp should use when starting a session. Configure xrdp to use xfce as the desktop environment:

1
echo xfce4-session >~/.xsession

Restart the xrdp service to apply the changes:

1
sudo service xrdp restart

Please note that installing a desktop environment on an Ubuntu Server may increase resource consumption. Therefore, if your server is intended solely for command-line operations or pure server functionalities, you should weigh the performance and security considerations before deciding to install a desktop environment.

Licensed under CC BY-NC-SA 4.0