Installing a Graphical Interface on Rocky/Alma Linux 8

XFCE Desktop Environment

The XFCE desktop environment was created as a branch of the Common Desktop Environment (CDE), embodying the modularity and reusability of the traditional Unix philosophy. You can install XFCE on almost any version of Linux, including Rocky Linux.

It is also one of the easiest desktop environments to use in conjunction with alternative window managers such as Awesome or i3. However, this process will help you get started and running with Rocky Linux and a typical XFCE installation.

Prerequisites

A workstation or laptop that you wish to run XFCE as the desktop instead of the default GNOME desktop.

Installing Minimal Rocky Linux

In this section, you need to be the root user or able to use sudo to elevate your privileges.

During the installation of Rocky Linux, we used the following sets of packages:

  • Minimal
  • Standard

Running System Updates

First, run the server update command. The system will rebuild the repository cache. This way, the system can recognize available packages.

dnf update

Enabling the dnf Repository

You need the unofficial XFCE repository from the EPEL repository to run on Rocky 8.x versions.

Enable this dnf repository by entering the following:

dnf install epel-release

Answer “Y” to install.

You will also need the Powertools and lightdm repositories. Now enable these:

dnf config-manager --set-enabled powertools
dnf copr enable stenstorp/lightdm

Again, you will see warning messages about the dnf repository. Proceed and answer Y when prompted.

Checking Available Environments and Tools in the Group

Now that the dnf repository is enabled, run the following command to check everything.

First, check your repository list:

dnf repolist

You should receive the following information showing all enabled repositories:

appstream                                                        Rocky Linux 8 - AppStream
baseos                                                           Rocky Linux 8 - BaseOS
copr:copr.fedorainfracloud.org:stenstorp:lightdm                 Copr repo for lightdm owned by stenstorp
epel                                                             Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                                                     Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                                                           Rocky Linux 8 - Extras
powertools                                                       Rocky Linux 8 - PowerTools

Run the following command to check for XFCE:

dnf grouplist

You should see “Xfce” at the bottom of the list.

Run <span>dnf update</span> once more to ensure all enabled repositories are read into the system.

Installing Packages

To install XFCE, run:

dnf groupinstall "xfce"

Also install <span>lightdm</span>:

dnf install lightdm

Final Steps

gdm was added and enabled during <span>dnf groupinstall "xfce"</span>, so it needs to be disabled:

systemctl disable gdm

Now you can enable <span>lightdm</span>:

sed -r -i 's#^user-sessions=.*#user-sessions=xfce#g' /etc/lightdm/lightdm.conf
systemctl enable lightdm --now

You need to tell the system to use only the graphical user interface after booting. Set the default target system to GUI:

systemctl set-default graphical.target

Then reboot:

reboot

You should finally see the login prompt in the XFCE GUI, and when you log in, you will have the full XFCE environment.

Command Collection

# Install xfce environment
dnf update
dnf install epel-release
dnf config-manager --set-enabled powertools
dnf copr enable stenstorp/lightdm
dnf groupinstall "xfce"
dnf groupinstall "Fonts"
dnf install lightdm
systemctl disable gdm

sed -r -i 's#^user-sessions=.*#user-sessions=xfce#g' /etc/lightdm/lightdm.conf
systemctl enable lightdm --now

# Install TurboVNC
TIMESTAMP=`date +%Y%m%d%H%M%S`

yum -y install wget
yum -y install perl

# firewalld
systemctl disable firewalld --now

# selinux
sed -i_bak`date +%Y%m%d%H%M%S` \
    's/^\s*SELINUX=.*/SELINUX=disabled/g' \
/etc/selinux/config

# add a file to disable non-privilege users' powermanagement
mkdir -p /etc/xdg/xfce4/kiosk
cat > /etc/xdg/xfce4/kiosk/kioskrc << EOF
[xfce4-session]
Shutdown=root
EOF

# setup for TurboVNC
wget https://raw.githubusercontent.com/TurboVNC/repo/main/TurboVNC.repo -O /etc/yum.repos.d/TurboVNC.repo
yum -y install turbovnc

# modify conf for TurboVNC
sed -i_bak${TIMESTAMP} \
    -e 's/#\s*\$wm = .*/\$wm = "xfce";/g' \
    -e 's/#\s*\$serverArgs = .*/\$serverArgs = "-listen tcp";/g' \
    -e 's/#\s*\$securityTypes = .*/\$securityTypes = "TLSOtp, TLSPlain, X509Otp, X509Plain,OTP, UnixLogin, Plain";/g' \
    /etc/turbovncserver.conf

sed -i_bak${TIMESTAMP} \
    -e 's/^#\s*permitted-security-types = .*/permitted-security-types =  TLSOtp, TLSPlain, X509Otp, X509Plain, OTP/g' \
    /etc/turbovncserver-security.conf

# modify conf for ssh and sshd
echo"AcceptEnv DISPLAY" >> /etc/ssh/sshd_config
systemctl restart sshd
echo"SendEnv   DISPLAY" >> /etc/ssh/ssh_config

# switch to graphical
systemctl set-default graphical.target
systemctl isolate graphical.target

reboot

Conclusion

XFCE is a lightweight environment with a simple interface. It is an alternative to the default GNOME desktop on Rocky Linux.

References

https://docs.rockylinux.org/guides/desktop/xfce_installation/

Related Extensions

Installing a Graphical Interface on Rocky/Alma Linux 8Introduction to IC Design Process and R&D EnvironmentInstallation of Cadence EDA ToolsHarmonious Patch Tools of the Three Major EDA Companies (S/C/M)Finding Features in EDA and Extracting to .src FilesRecently Released Synopsys License Generation ToolCommon EDA Tool License Call Variable ConfigurationProcess of Installing EDA Tools with WSL2

Leave a Comment