XRDP is a free application that allows you to connect to a Linux server from Windows machines over the RDP protocol.
In this guide, you will learn how to enable XRDP on Red Hat-based distributions (AlmaLinux 8 and 9 versions).
Import GPG key repository (on AlmaLinux 8 only)
This step is for AlmaLinux 8 only.
You can skip this step if you are installing XRDP on AlmaLinux 9.
Run the following command to install the GPG key repository on AlmaLinux 8:
rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux
Installation Guide
1. Updating the packages:
dnf update
2. Installing a graphical user interface (GUI):
dnf groupinstall "Server with GUI"
3. To enable the GUI at boot by default:
systemctl set-default graphical.target
4. Installing EPEL repository (extra packages for Enterprise Linux)
dnf install epel-release
5. Installing the XRDP:
dnf install xrdp
6. Starting and enabling XRDP Service:
systemctl start xrdp
systemctl enable xrdp
7. Enabling the RDP port
To open port 3389 (the default RDP port), run the following command:
iptables -I INPUT -p tcp -m tcp --dport 3389 -j ACCEPT
To save the changes:
iptables-save
If you use a firewall, to open port 3389, use this command:
firewall-cmd --add-port=3389/tcp --permanent
Reloaded the firewall:
firewall-cmd --reload
Reboot the server after performing the above steps.
Check if RDP is installed:
systemctl status xrdp
7. Accessing the server using Remote Desktop Connection Protocol (RDP)
Log in from a Windows computer:
The RDP is a free application that allows you to connect. It's installed by default on all Windows OS devices:
Click "Connect" and you will see the default XRDP login page, where you need to enter the password of your server:
Computer: Your_server_IP
Username: root
Log in from Linux:
To connect from Linux, you can use RDP tools like "desktop":
rdesktop -u root -p PASSWORD -g 1024x768 YOUR_SERVER_IP
Change the "PASSWORD" and "YOUR_SERVER_IP" to ones that match your server.
You can always change the resolution by updating the "-g 1024x768" parameter.
Please note: the first time you connect, the desktop environment will take a little longer to load than usual. This is expected behavior.