CentOS Stream release 9 is a cutting-edge Linux distribution that provides a stable yet dynamic platform for developers and system administrators. If you prefer a lightweight and customizable desktop environment, XFCE is an excellent choice. Additionally, if you need to access this environment remotely, XRDP provides a convenient way to do so via the Microsoft Remote Desktop Protocol (RDP). Let’s dive into the installation process and also cover how to uninstall if needed.
🛠️ Prerequisites
- A system running CentOS Stream release 9
- Sudo or root privileges
- Stable internet connection
📦 Installing XFCE Desktop Environment
Before you start, make sure your package index is up to date:
sudo dnf update -y
Install the XFCE package group:
sudo dnf groupinstall -y "Xfce"
Set the default target to graphical (runlevel 5):
sudo systemctl set-default graphical.target
Reboot your system to start using XFCE:
sudo reboot
After the reboot, you should be greeted with the XFCE login screen.
🖥️ Installing XRDP
To install XRDP for remote desktop access, follow these steps:
Install theEPEL repository:
sudo dnf install -y epel-release
Install XRDP:
sudo dnf install -y xrdp
Start and enable XRDP service:
sudo systemctl enable --now xrdp
Allow XRDP through the firewall:
sudo firewall-cmd --permanent --add-port=3389/tcp
sudo firewall-cmd --reload
You can now connect to your CentOS system with any RDP client using the system’s IP address.
🔄 Uninstalling XFCE and XRDP
Should you need to remove XFCE and XRDP, here are the steps:
Remove XFCE:
sudo dnf groupremove -y "Xfce"
sudo dnf remove -y thunar
Remove XRDP:
sudo systemctl stop xrdp
sudo systemctl disable xrdp
sudo dnf remove -y xrdp
sudo firewall-cmd --permanent --remove-port=3389/tcp
sudo firewall-cmd --reload
If you changed the default target, revert it back to multi-user (runlevel 3):
sudo systemctl set-default multi-user.target
Reboot your system:
sudo reboot
Your system should now boot into the command-line interface without the XFCE desktop environment and XRDP.