Share your love
Install and Configure XRDP on AlmaLinux 9
This guide intends to teach you How To Install and Configure XRDP on AlmaLinux 9.
XRDP is defined as an open-source implementation for the Desktop Protocol, also known as Microsoft Remote Desktop Protocol, enabling users to graphically control the remote system.
In order to use Linux XRDP, one needs to have XRDP in the system. In the recent Linux distributions, it is often seen that XRDP comes as a package in the distribution itself. This XRDP, which is accompanied by the distribution, is generally the latest release of XRDP. Also, one needs to also have the xorgxrdp package for the best experience.
Steps To Install and Configure XRDP on AlmaLinux 9
To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide the Initial Server Setup with AlmaLinux 9.
Install Desktop environment on AlmaLinux 9
The desktop environment isn’t available on AlmaLinux 9 by default. Gnome is the default desktop environment on AlmaLinux 9. To install it, use the following command:
sudo dnf groupinstall "Server with GUI" -y
Your installation may take some time to complete.
When you are finished, you can start to install Xrdp on AlmaLinux 9.
Install XRDP on AlmaLinux 9
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 -y
Now you can install Xrdp on AlmaLinux 9 with the following command:
sudo dnf install xrdp -y
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 9 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 pres> Active: active (running) since Mon 2022-09-19 05:09:16 EDT; 6s ago Docs: man:xrdp(8) man:xrdp.ini(5) Main PID: 13167 (xrdp) Tasks: 1 (limit: 23609) Memory: 1.1M CPU: 7ms CGroup: /system.slice/xrdp.service └─13167 /usr/sbin/xrdp --nodaemon ...
Now that you have Xrdp active and running on your server, let’s configure Xrdp on AlmaLinux 9.
Configure XRDP on AlmaLinux 9
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.
Configure Firewall For XRDP
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 9 system.
Access AlmaLiunux 9 Desktop environment
To access the remote AlmaLinux 9, 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.
Conclusion
At this point, you learn to Install and Configure XRDP on AlmaLinux 9.
Hope you enjoy it.