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 the following. It’s vital to know and understand that the Distrobox developer is considering using Distrobox for this purpose, “an experiment.”
- ⚠️ Important: This tutorial is based on this part of the documentation of Distrobox, so YMMV.
With that said, let’s see how you can add other DEs to Nitrux.
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 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, Gnome 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 X11 sessions are stored in the root directory; see XFS Features and Root Immutability in Nitrux.
- ⚠️ Important: As noted in the source for creating this tutorial, the launcher can launch a Wayland session, but YMMV.
>> 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.
- ⚠️ Important: We need to move the script file to the directory in the root file system; see XFS Features and Root Immutability in Nitrux.
>> 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
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, Gnome Software was not able to display content. We guess both issues could be related to DBus, so it could be something that Distrobox could resolve (definitely, it isn’t a bug caused by Nitrux or in Nitrux); however, as we noted earlier, using Distrobox for this purpose is experimental (as noted by its developer.)
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 distribution uses).
That’s it; this concludes today’s tutorial.