How to Install KDE Plasma Desktop Environment on CentOS Stream 9 and Configure XRDP

CentOS Stream 9 is a rolling-release Linux distribution that serves as a midstreambetween the upstream development in Fedora and the downstream development for Red Hat Enterprise Linux. It’s a solid choice for those who prefer a more stable system but still want access to newer software. KDE Plasma is a modern desktop environment that is both powerful and customizable. In this guide, we will walk through the process of installing KDE Plasma on CentOS Stream 9 and setting up xRDP for remote desktop access.

🛠️ Installing KDE Plasma Desktop

Before you begin the installation, you should ensure that your system is up to date by running the following commands:

  • Update your system:
    sudo dnf update -y
  • Install the EPEL (Extra Packages for Enterprise Linux) repository:
    sudo dnf install epel-release -y
  • Enable the PowerTools repository which is required for some dependencies:
    sudo dnf config-manager --set-enabled powertools

Now, let’s install KDE Plasma:

  • Install the KDE Plasma Workspaces and necessary xorg packages:
    sudo dnf groupinstall "KDE Plasma Workspaces" "base-x" -y
  • Optionally, you can install additional KDE applications:
    sudo dnf groupinstall "KDE Applications" -y
  • Once the installation is complete, you can set KDE Plasma as the default desktop environment:
    sudo systemctl set-default graphical.target
  • Reboot your system to start using KDE Plasma:
    sudo reboot

🔗 Configuring xRDP

With KDE Plasma installed, you can now set up xRDP to access your desktop environment remotely.

  • First, install xRDP:
    sudo dnf install xrdp -y
  • Start the xRDP service:
    sudo systemctl enable xrdp --now
  • Configure your firewall to allow RDP connections:
    sudo firewall-cmd --add-port=3389/tcp --permanent
    sudo firewall-cmd --reload

To ensure xRDP uses the KDE desktop, you should create a new file named ~/.xsession with the following content:

  • Edit or create the .xsession file in your home directory:
    echo "exec startplasma-x11" > ~/.xsession
  • Ensure the ~/.xsession file is executed when you start an xRDP session by editing the /etc/xrdp/startwm.sh file:
    sudo sed -i 's/. \/etc\/X11\/Xsession/exec \/bin\/sh ~\/.xsession/g' /etc/xrdp/startwm.sh

Now, you can connect to your CentOS Stream 9 machine using any RDP client by entering the machine’s IP address and the credentials of the user you configured.

🗑️ Uninstalling KDE Plasma and xRDP

If you decide to remove KDE Plasma and xRDP from your system, follow these steps:

  • Stop the xRDP service:
    sudo systemctl stop xrdp
  • Disable the xRDP service:
    sudo systemctl disable xrdp
  • Remove the xRDP package:
    sudo dnf remove xrdp -y
  • Remove KDE Plasma Workspaces and related packages:
    sudo dnf groupremove "KDE Plasma Workspaces" -y
  • Remove any additional KDE applications you may have installed:
    sudo dnf groupremove "KDE Applications" -y
  • Optionally, remove the .xsession file:
  • rm ~/.xsession

    After completing these steps, KDE Plasma and xRDP should be completely removed from your system.

Scroll to Top