CentOS Linux is a stable, predictable, manageable and reproducible platform derived from the sources of Red Hat Enterprise Linux (RHEL). By default, CentOS 7 comes with GNOME 3 as the desktop environment. In this article, we will guide you through the process of installing the KDE Plasma desktop environment on CentOS 7.9, along with XRDP for remote desktop capability.
🛠️ Prerequisites
- A system running CentOS Linux release 7.9
- Sudo or root privileges
- Internet connection
🖥️ Installing KDE Plasma Desktop
To install the KDE Plasma desktop environment on your CentOS 7 system, follow these steps:
- Update your system
Ensure your system is up-to-date with the latest packages and security patches.
sudo yum update -y
- Install EPEL Repository
The Extra Packages for Enterprise Linux (EPEL) repository contains additional packages, including KDE. Install it using the following command.
sudo yum install epel-release -y
- Install KDE Plasma Desktop
Now you can install the KDE Plasma Workspaces alongside the necessary X Window System using the following command.
sudo yum groupinstall "KDE Plasma Workspaces" "X Window System" -y
- Switch to the KDE Desktop
You need to tell your system to start up with the KDE desktop. You can do this by editing the
.xinitrc
file.echo "exec startkde" >> ~/.xinitrc
- Reboot System
After the installation is complete, it is a good idea to reboot your system to start using the KDE desktop.
sudo reboot
🌐 Installing XRDP
XRDP is an open-source Remote Desktop Protocol (RDP) server, which allows you to RDP into your Linux server from a Windows machine. It’s a great tool for managing remote Linux GUI.
- Install XRDP Server
To install XRDP on your CentOS system, run the following command.
sudo yum install xrdp -y
- Start and Enable XRDP Service
After installing XRDP, you need to start the service and enable it on boot.
sudo systemctl start xrdp sudo systemctl enable xrdp
- Configure Firewall
If you have a firewall running, you need to allow the RDP port (default is 3389).
sudo firewall-cmd --permanent --add-port=3389/tcp sudo firewall-cmd --reload
🔗 Configuring XRDP to Use KDE
You need to configure XRDP to use KDE as your desktop environment when you connect remotely. Here are the steps to set it up:
- Edit XRDP’s StartWM Script
Edit the
startwm.sh
script to start the KDE environment.sudo sed -i 's/startkde/&/g' /etc/xrdp/startwm.sh
- Restart XRDP Service
For the changes to take effect, restart the XRDP service.
sudo systemctl restart xrdp
🚮 Uninstalling KDE
If you wish to uninstall KDE Plasma Desktop from your CentOS 7.9 system, follow these steps:
- Remove KDE Packages
Remove the installed KDE packages from your system.
sudo yum groupremove "KDE Plasma Workspaces" -y
- Remove Dependencies
Remove any unused dependencies that were installed with KDE.
sudo yum autoremove -y
- Revert to Default Desktop (Optional)
If you want to revert to the default GNOME desktop, you can delete the
.xinitrc
file in your home directory.rm ~/.xinitrc
- Reboot System
Finally, reboot your system for the changes to take effect.
sudo reboot
Conclusion
You have now learned how to install KDE Plasma Desktop and XRDP on CentOS 7.9 for a versatile and remote accessible desktop environment. Additionally, you know how to uninstall KDE should you choose to revert to your previous desktop environment. These steps can help enhance your productivity and flexibility when managing CentOS servers.