Skip to main content

Today’s tutorial will check how to install another desktop environment in Nitrux using Distrobox. For this example, we’ll be installing and using GNOME.

However, let me start by stating the following.

Our primary focus is with Plasma and MauiKit.

Next, let’s clarify that it’s vital to know and understand that the Distrobox developer is considering using Distrobox for this purpose, “an experiment.”

With that said, let’s see how you can add other DEs to Nitrux.

Difficulty: ★★☆☆☆

📜 Table of Contents

  1. Installing a different Desktop Environment
  2. Troubleshooting
    1. Launching applications from the GNOME Overview doesn’t work

First, some context: what is a desktop environment? In computing, a desktop environment (DE) implements the desktop metaphor of a bundle of programs running on top of a computer operating system that shares a standard graphical user interface (GUI), sometimes described as a graphical shell.

Following this description, NX Desktop is not a desktop environment but a customization layer (as we’ve stated multiple times), but Maui Shell + Maui Apps would constitute a desktop environment. So, with that knowledge in mind, let’s get started.

Installing a different Desktop Environment

Following up on our tutorial on using Distrobox, we will use the container we created to install GNOME. The following command will install the GNOME meta-package, which includes GNOME Shell and various GNOME apps, including Nautilus, Rhythmbox, Tweaks, Software, etc.

  • 🔰 Information: The meta-package may not include other software or artwork you expect, so install it.
distrobox enter --name debian-stable-distrobox -- sudo apt install gnome

After the command completes the installation, we must create a session file. We tested using an X11 session, as adding the session file to the Wayland sessions directory didn’t work.

>> distrobox-gnome.desktop printf "%s\n" \
'[Desktop Entry]' \
'Name=GNOME Distrobox (X11)' \
'Comment=This session logs you into GNOME Distrobox (X11)' \
'Exec=distrobox enter --name debian-stable-distrobox -- /usr/bin/gnome-session' \
'TryExec=distrobox enter --name debian-stable-distrobox -- /usr/bin/gnome-session' \
'Type=Application' \
'DesktopNames=GNOME' \
'X-GDM-SessionRegisters=true'

sudo mv distrobox-gnome.desktop /usr/share/xsessions/

Then, we need to create a script that will attempt to correct the permissions of the X11 socket so that the container can display graphical output when we log in to the GNOME session.

>> fix_tmp.sh printf "%s\n" \
'chown -f -R $USER:$USER /tmp/.X11-unix'

sudo mv fix_tmp.sh /etc/profile.d/

Then, log out of Plasma, and log in to GNOME.

Et voila!, we’re logged into GNOME. If you’d like to install other desktop environments or window managers, we’ll list some of the meta-packages available in Debian.

  • 🔰 Information: If you’re using another Linux distribution for your container, please refer to each distribution package search method to find the appropriate name of the meta-packages.
  • 🔰 Information: We used Debian 12 for this tutorial; if you want to use a newer version of GNOME (or other desktop environments or window managers), create a container with distributions such as Debian unstable, Fedora Rawhide, Arch Linux, Gentoo, NixOS, Alpine Linux, etc.
### Plasma (Vanilla)
distrobox enter --name debian-stable-distrobox -- sudo apt install kde-plasma-desktop

### XFCE
distrobox enter --name debian-stable-distrobox -- sudo apt install xfce4

### LXQt
distrobox enter --name debian-stable-distrobox -- sudo apt install lxqt

### MATE
distrobox enter --name debian-stable-distrobox -- sudo apt install mate-desktop-environment

### Cinnamon
distrobox enter --name debian-stable-distrobox -- sudo apt install cinnamon-desktop-environment

### Enlightment
distrobox enter --name debian-stable-distrobox -- sudo apt install enlightment

### i3
distrobox enter --name debian-stable-distrobox -- sudo apt install i3

### jwm
distrobox enter --name debian-stable-distrobox -- sudo apt install jwm

Troubleshooting

Launching applications from the GNOME Overview doesn’t work

For an unknown reason (possibly due to DBus), launching some applications from the Overview doesn’t work out of the box; to alleviate this problem remove “%U” from “Exec= in all launchers in /usr/share/applications within the container.

  • 🔰 Information: This action will be necessary every time a new desktop launcher is added, i.e., whenever software (mostly graphical applications) is installed. This is not a bug in Nitrux, caused by Nitrux, or only affecting Nitrux.
  • 🔰 Information: The command below is intended to be run from the host, if you’re in the GNOME session and thus inside the container, only enter the command starting with sudo.
distrobox enter --name debian-stable-distrobox -- sudo find /usr/share/applications -type f -name '*.desktop' -exec sed -i 's/%U//g' {} +

To use GNOME Software or Synaptic (if using the container in this tutorial), refer to the tutorial to use Distrobox, Issues with PolicyKit Authentication.


That’s it; this concludes today’s tutorial.