Skip to main content

Update 01/01/2023: We have updated this tutorial to reflect the changes done in Nitrux 2.6.0, including the discontinuation of the Minimal ISO.


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

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. So first, we need to install it.

The following command will install the GNOME meta-package, which includes GNOME Shell and various GNOME apps, including Nautilus, Rhythmbox, Tweaks, Software, etc. The meta-package may not include other software you expect, so install it.

distrobox-enter --name debian11-distrobox -- sudo apt install gnome

After the command completes the installation, we must create a session file.

  • ⚠️  Important: Use the correct container name for the launcher to work.
  • ⚠️  Important: We must move the session file to the directory where sessions are stored in the root directory; see XFS Features and Root Immutability in Nitrux. The directory will differ depending on which session we want to use: X11 (/usr/share/xsessions) or Wayland (/usr/share/wayland-sessions).
>> distrobox-gnome.desktop printf "%s\n" \
'[Desktop Entry]' \
'Name=GNOME' \
'Comment=This session logs you into GNOME' \
'Exec=distrobox-enter -n debian11-distrobox -- /usr/bin/gnome-session --builtin' \
'Type=Application' \
'DesktopNames=GNOME' \
'X-GDM-SessionRegisters=true'

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

### OR for Wayland

sudo mv distrobox-gnome.desktop /usr/share/wayland-sessions/

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/

Once we’ve done both tasks, the final task is to create two symbolic links inside the container. To avoid confusion, we should enter the container.

distrobox-enter --name debian11-distrobox

Once inside the container, run the following commands.

sudo ln -sv /run/host/run/dbus /run/dbus
sudo ln -sv /run/host/run/systemd/system /run/systemd/system

Then, we type exit to log out of the container, log out of Plasma, and log in to GNOME.

And so, we’re using 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 11 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, the latest Fedora, Arch Linux, Gentoo, etc.
### XFCE
distrobox-enter --name debian11-distrobox -- sudo apt install xfce4

### LXQt
distrobox-enter --name debian11-distrobox -- sudo apt install lxqt

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

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

### Enlightment
distrobox-enter --name debian11-distrobox -- sudo apt install enlightment

### i3
distrobox-enter --name debian11-distrobox -- sudo apt install i3

### jwm
distrobox-enter --name debian11-distrobox -- sudo apt install jwm

Troubleshooting

GNOME

For an unknown reason, launching some apps from the Overview will not launch the apps; as a workaround, what we tested was to copy the launcher from /usr/share/applications (within the container, of course), then edit the file and removing “%U” from the Exec= line and then adding the launcher back to /usr/share/applications.

Likewise, the Software store was not able to display content. We guess both issues could be related to DBus, as we noted on our tutorial to use Distrobox, so it could be something that Distrobox could resolve (it isn’t a bug caused by Nitrux or in Nitrux); however, as we noted earlier, using Distrobox for this purpose is “an experiment.”

Another possibility could be that it may be related to systemd and how it handles users since the container will include systemd (if that’s what the containerized distribution uses).


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