How to Install a Graphical Interface on a Linux Cloud Server and Use Remote Desktop Connection?

23-01-2024 02:08:36

Remote Desktop Protocol (RDP) is a protocol developed by Microsoft that allows for a graphical connection to another computer over a network. RDP supports encryption, remote audio, and the loading of local drivers. xrdp is an open-source RDP project that runs on the Linux operating system. This guide explains how to install a graphical interface and xrdp on a Linux cloud server, detailing the steps for both Ubuntu 20.04 and CentOS 7 operating systems. These instructions can be adapted for other operating systems as well. Note: It is recommended to have at least 2GB of system memory when using a Linux graphical interface.

Ubuntu 20.04

Update the operating system and reboot:

apt update && apt upgrade
reboot

Install tasksel and ubuntu-desktop, then reboot:

apt install tasksel
tasksel install ubuntu-desktop
reboot

Install xrdp:

apt install xrdp

Optionally change the default remote port from 3389:

sed -i 's/3389/13389/g' /etc/xrdp/xrdp.ini

If a firewall is enabled, set up the remote port in the firewall settings:

ufw allow 13389

Use Windows Remote Desktop Connection tool to log in with the root username and password.

Begin using various applications like the Firefox browser.

CentOS 7

Update the operating system and reboot:

yum update
reboot

Install GNOME Desktop, then reboot:

yum -y groups install "GNOME Desktop"
reboot

Install xrdp:

yum install epel-release
yum install xrdp
systemctl start xrdp

Optionally change the default remote port from 3389:

sed -i 's/3389/13389/g' /etc/xrdp/xrdp.ini
systemctl restart xrdp

If a firewall is enabled, set up the remote port in the firewall settings:

firewall-cmd --permanent --add-port=13389/tcp
firewall-cmd --reload

Use Windows Remote Desktop Connection tool to log in with the root username and password.