Table of Contents
Prerequisites
- Ubuntu Server
- User with root (sudo) privileges
Install and set up Display Manager
1️⃣ SSH to the Ubuntu server then refresh the repository and package lists, and perform the necessary upgrades with the following command:
sudo apt update -y && sudo apt upgrade -y
2️⃣ In this step, we will install the display manager. A display manager is an application that starts the display server, launches the desktop, and manages user authentication.
The default GDM3 is a resource-intensive display manager. To conserve system resources, consider a lighter tool, such as SLiM or LightDM.
This guide uses SLiM to illustrate the rest of the GUI installation process. Run command below to install it:
sudo apt install slim -y
Install GUI on Ubuntu Server
3️⃣ With a display manager installed, proceed to install a GUI. The default Ubuntu Desktop is a modified version of the GNOME desktop environment. But ln this post, we’ll using LXDE.
LXDE IS a desktop environment with a very lightweight GUI. Use LXDE if you need a graphical interface but want to minimize the impact on system memory and CPU. Run the following command to install the LXDE:
sudo apt install lxde -y
Enable Remote Desktop RDP on Ubuntu
4️⃣ Remote Desktop Protocol is a proprietary system developed by Microsoft. It has proven so successful that RDP server and client apps are available on most software platforms.
Next, you’ll need to install xrdp. This is an RDP server for Ubuntu (and other Linux devices) and is required before remote connection.
sudo apt install xrdp -y
5️⃣ Once installed, enable to start after reboot and run the remote desktop sharing server xrdp and open a firewall port 3389 for an incoming traffic:
sudo systemctl enable --now xrdp
sudo ufw allow 3389/tcp
Set Up a Remote Desktop RDP Connection With Ubuntu
Open Remote Desktop Connection app. Input the IP address of your Ubuntu computer and click Connect.
Enter the password of the remote Ubuntu user.
You should now be remotely connected to the Ubuntu Desktop share from your Windows 10, 11 computer.
Removing the GUI and Display Manager
To revert to the command line interface and remove the packages related to the display manager and the desktop environments:
Open the terminal, and enter:
sudo apt remove [display-manager] [desktop-environment]
For example, to remove SLiM and LXDE, type:
sudo apt remove slim lxde -y
Reboot the system and log back in.
Finish by removing orphaned or unnecessary dependencies with autoremove:
sudo apt autoremove
Not a reader? Watch this related video tutorial: