In this article, we want to teach you how to Set up and Configure XRDP on AlmaLinux 8.
XRDP provides a graphical login to remote machines using RDP (Microsoft Remote Desktop Protocol). It accepts connections from a variety of RDP clients: FreeRDP, rdesktop, NeutrinoRDP, and Microsoft Remote Desktop Client (for Windows, macOS, iOS, and Android).
How To Set up and Configure XRDP on AlmaLinux 8
To set up and configure Xrdp, you need to log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do these, you can follow our article about the Initial Server Setup with AlmaLinux 8.
When you are done, you need to install the Desktop environment first.
Install Desktop environment on AlmaLinux 8
The desktop environment isn’t available on AlmaLinux 8 by default. Gnome is the default desktop environment on AlmaLinux 8. To install it use the following command:
sudo dnf groupinstall "Server with GUI"
Your installation may take some time.
When you are finished, you can start to install Xrdp on AlmaLinux 8.
Install XRDP on AlmaLinux 8
Xrdp is available in the Epel repository. You need to install the Epel repo on your server with the following command:
sudo dnf install epel-release
Now you can install Xrdp on AlmaLinux 8 with the following command:
sudo dnf install xrdp
When your installation is finished, you need to start and enable the service with the following command:
sudo systemctl enable xrdp --now
Verify that Xrdp is active and running on AlmaLinux 8 with the following command:
sudo systemctl status xrdp
In your output you will see:
Output xrdp.service - xrdp daemon Loaded: loaded (/usr/lib/systemd/system/xrdp.service; enabled; vendor preset> Active: active (running) since Sun 2021-11-07 04:10:41 EST; 57s ago Docs: man:xrdp(8) man:xrdp.ini(5) Main PID: 81281 (xrdp) Tasks: 1 (limit: 11409) Memory: 844.0K CGroup: /system.slice/xrdp.service └─81281 /usr/sbin/xrdp --nodaemon
Now that you have Xrdp active and running on your server, let’s configure Xrdp on AlmaLinux 8.
Configure XRDP on AlmaLinux 8
For basic Xrdp connections, you do not need to make any changes to the configuration files. Xrdp uses the default X Window desktop, which in this case, is Gnome.
The configuration files are located in the /etc/xrdp directory. And the main configuration file is the xrdp.ini. It allows you to set global configuration settings like security and listening addresses and create different xrdp login sessions.
Just remember every time you make any changes you need to restart the Xrdp to apply the changes:
sudo systemctl restart xrdp
Also, Xrdp uses the startwm.sh file to launch the X session. If you want to use another X Window desktop, edit this file.
Here you need to add a rule to allow traffic on the Xrdp port. By default, Xrdp listens on port 3389. Typically you would want to allow access to the Xrdp server only from a specific IP address or IP range.
To do this, run the following commands:
sudo firewall-cmd --new-zone=xrdp --permanent
sudo firewall-cmd --zone=xrdp --add-port=3389/tcp --permanent
sudo firewall-cmd --zone=xrdp --add-source=192.168.1.0/24 --permanent
To allow traffic to port 3389 from anywhere you can use the following command instead:
sudo firewall-cmd --add-port=3389/tcp --permanent
After this, you need to reload the firewall to apply these changes:
sudo firewall-cmd --reload
Now that the Xrdp server is configured, it is time to open your local Xrdp client and connect to the remote AlmaLinux 8 system.
Access the AlmaLiunux 8 Desktop environment
To access the remote AlmaLinux 8, open the run window with Winky+R and type the “mstsc” in it. This will open the RDP client. Type your IP address and click connect:
This will display a warning that the identity of the remote computer cannot be verified.
Click the don’t ask me again and press yes to continue:
Now on the login screen enter your server’s username and password:
Once logged in, you should see the default Gnome desktop. It should look something like this:
You can now start interacting with the remote desktop from your local machine using your keyboard and mouse.
Note: If you are using macOS, you can install the Microsoft Remote Desktop application from the Mac App Store. Linux users can use an RDP client such as Remmina or Vinagre.
At this point, you learn to install and configure XRDP on AlmaLinux 8 and you can easily manage your AlmaLinux 8 server from your local desktop machine.
Hope you enjoy it.
Also, you may be interested in these articles: