Skip to main content

Enable GUI access to a Rocky Linux VM

This guide explains how to install a lightweight graphical environment (XFCE) and configure XRDP to enable remote desktop access to your Rocky Linux virtual machine.

Note: You must have sudo privileges to perform the installation steps.


πŸ”§ Step 1: Update the System

sudo dnf update -y

Β 

πŸ§ͺ Step 2: Install EPEL repository

The installation of theΒ XFCE desktop environment requires to install the EPEL repository which is a repository that provides high-quality software packages for RHEL-distributions.

sudo dnf install epel-release -y

πŸŽ›οΈ Step 3: Install XFCE Desktop Environment

sudo dnf groupinstall "Xfce" -y

Β 

πŸ“¦ Step 4: Install XRDP

sudo dnf install xrdp -y

Β 

πŸ”„ Step 5: Enable and Start XRDP

sudo systemctl enable xrdp --now

Check the service status:

sudo systemctl status xrdp

You should see "active (running)".

Β 

πŸ” Step 6: Open RDP Port in Firewall

sudo firewall-cmd --permanent --add-port=3389/tcp 
sudo firewall-cmd --reload

Β 

πŸ› οΈ Step 7: Set XFCE as the Default Desktop for XRDP Sessions

Create or modify your user’s .Xclients file:

echo "startxfce4" > ~/.Xclients chmod +x ~/.Xclients

To apply this for all new users, you can add it toΒ /etc/skel/:

echo "startxfce4" | sudo tee /etc/skel/.Xclients 
sudo chmod +x /etc/skel/.Xclients

Β 

πŸ”„ Step 8: Reboot the system

To ensure all services and graphical environment changes take effect, reboot the virtual machine:

sudo systemctl reboot

Wait a few moments for the system to come back online.

πŸ’» Step 9: Connect via Remote Desktop

From your local machine, open your Remote Desktop Client (RDP) and connect to:

<VM_IP_ADDRESS>:3389

Log in using your UNIL username and password.

image.png


If you need further help, please contact your system administrator or open a support ticket with the helpdesk (helpdesk@unil.ch).