Install and Configure xrdp Server on AlmaLinux 10

In this tutorial, you will learn how to install and configure xrdp server on AlmaLinux 10, enabling remote desktop access. Whether your system is a headless server or already has a desktop environment, this guide ensures a seamless setup for remote desktop protocol (RDP) connections. Follow these instructions to set up a lightweight workstation environment with GNOME, KDE, or XFCE, install xrdp, and configure it for secure and efficient remote access.

Install and Configure xrdp Server on AlmaLinux 10

Prerequisites

  • AlmaLinux 10 installed (headless server or desktop environment).
  • Root or sudo privileges.
  • Internet connection for package installation.
  • Basic familiarity with Linux terminal commands.

Step 1: Verify or Install a Desktop Environment

xrdp requires a graphical desktop environment to function, as RDP is designed for desktop access. If your AlmaLinux 10 system is a headless server, you’ll need to install a desktop environment. If a desktop environment is already installed, skip to Step 2.

Installing a Desktop Environment on a Headless Server

For a lightweight setup, we recommend installing the GNOME desktop environment as part of the “Workstation” group, which is leaner than a full server with GUI. Alternatively, you can install KDE or XFCE for different preferences.

Option 1: Install GNOME (Workstation)

  1. Enable the CodeReady Builder (CRB) and EPEL repositories:
    sudo dnf config-manager --set-enabled crb
    sudo dnf install epel-release
  2. Install the GNOME Workstation group:
    sudo dnf groupinstall "Workstation"

Option 2: Install KDE (Optional)

If you prefer KDE, install the KDE Plasma desktop:

sudo dnf groupinstall "KDE Plasma Workspaces"

Option 3: Install XFCE (Optional)

For a lightweight alternative, install XFCE:

sudo dnf groupinstall "Xfce"

Set Graphical Target

Ensure the system boots into graphical mode:

sudo systemctl set-default graphical.target

Reboot to apply changes:

sudo reboot

Step 2: Install xrdp

xrdp is available in the EPEL repository. Follow these steps to install it.

  1. Enable the EPEL repository (if not already enabled):
    sudo dnf config-manager --set-enabled crb
    sudo dnf install epel-release
  2. Install xrdp:
    sudo dnf install -y xrdp
  3. Heads up. As of this writing, the EPEL repos do not provide XRDP package to EL10 yet. In that case, just download the EL9 RPM and install as follows:
    sudo dnf install -y https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/tigervnc-license-1.14.1-8.el9_6.noarch.rpm
    sudo dnf install -y https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/tigervnc-server-minimal-1.14.1-8.el9_6.x86_64.rpm
    sudo dnf install -y https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/x/xrdp-0.10.3-1.el9.x86_64.rpm
  4. Verify the installation.
    The command below should display the installed xrdp version.:
    xrdp --version

Step 3: Start and Enable xrdp Service

After installation, start the xrdp service and enable it to run at boot.

  1. Start the xrdp service:
    sudo systemctl start xrdp
  2. Enable xrdp to start on boot:
    sudo systemctl enable xrdp
  3. Verify the service status:
    sudo systemctl status xrdp
    Ensure the output shows xrdp as active (running).

Step 4: Configure Firewall for RDP

xrdp uses port 3389 by default. Configure the firewall to allow RDP connections.

  1. Open port 3389:
    sudo firewall-cmd --permanent --add-port=3389/tcp
  2. Reload the firewall to apply changes:
    sudo firewall-cmd --reload
  3. To allow xrdp connections (port 3389) from a specific network or IP in the firewall on AlmaLinux 10, use the following commands inline. Replace 192.168.1.0/24 with your specific network or IP.
    sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="3389" protocol="tcp" accept'
    sudo firewall-cmd --reload
    For a single IP, replace 192.168.1.0/24 with, e.g., 192.168.1.100. This restricts RDP access to the specified network or IP, enhancing security.

Step 5: Configure xrdp for Desktop Sessions

xrdp uses a backend like Xvnc to connect to the desktop environment. Configure the startup script to ensure compatibility with your chosen desktop environment (GNOME or XFCE).

Configure GNOME Session

For GNOME (Workstation), update the xrdp startup script:

  1. Edit the startup script:
    sudo vim /etc/xrdp/startwm.sh
  2. Replace the content with:
    #!/bin/sh
    unset DBUS_SESSION_BUS_ADDRESS
    exec /usr/bin/gnome-session
  3. Save and exit the file.

Configure XFCE Session (Optional)

If you installed XFCE, update the startup script:

  1. Edit the startup script:
    sudo vim /etc/xrdp/startwm.sh
  2. Replace the content with:
    #!/bin/sh
    unset DBUS_SESSION_BUS_ADDRESS
    exec startxfce4
  3. Save and exit the file.

Step 6: Configure SELinux for xrdp

If SELinux is enabled (default on AlmaLinux) and XRDP is not behaving as expected check SELinux logs for denials:

sudo ausearch -m avc

sudo sealert -a /var/log/audit/audit.log

Create custom SELinux policies if necessary.

    Step 7: Test the xrdp Connection

    From a remote machine, use an RDP client (e.g., Microsoft Remote Desktop, Remmina) to connect to your AlmaLinux 10 server using its IP address and port 3389.

    From Arch Linux, let’s use Remmina.

    Install and Configure xrdp Server on AlmaLinux 10

    Log in with your AlmaLinux user credentials.

     install and configure the xrdp server on AlmaLinux 10

    Troubleshooting Tips

    • Check the service status (sudo systemctl status xrdp) and logs (journalctl -u xrdp) for any errors.
    • Blank screen on RDP login: Ensure the correct desktop session is configured in /etc/xrdp/startwm.sh.
    • Connection refused: Verify that port 3389 is open (sudo firewall-cmd –list-ports) and xrdp is running.
    • SELinux issues: Review SELinux denials and adjust policies as needed.

    That marks the end of our tutorial on how to nstall and configure xrdp server on AlmaLinux 10.

    Other Tutorials

    Remote desktop tutorials

    SUPPORT US VIA A VIRTUAL CUP OF COFFEE

    We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

    Photo of author
    Kifarunix
    DevOps Engineer and Linux Specialist with deep expertise in RHEL, Debian, SUSE, Ubuntu, FreeBSD... Passionate about open-source technologies, I specialize in Kubernetes, Docker, OpenShift, Ansible automation, and Red Hat Satellite. With extensive experience in Linux system administration, infrastructure optimization, information security, and automation, I design and deploy secure, scalable solutions for complex environments. Leveraging tools like Terraform and CI/CD pipelines, I ensure seamless integration and delivery while enhancing operational efficiency across Linux-based infrastructures.

    Leave a Comment