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.

Let me start by stating the following.

Our primary focus is with Plasma and MauiKit.

It’s vital to know that the Distrobox developer considers using Distrobox for this purpose “an experiment,” so have that in mind.

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.

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

Difficulty: ★★☆☆☆

Get Started

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 need to create a session file.

  • ⚠️  Important: Use the correct container name for the launcher to work.
  • ⚠️  Important: We need to move the session file to the directory where X11 sessions are stored in the root directory, so make sure to read the Notes to know how to work with overlayroot.
  • ⚠️  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, so make sure to read the Notes to know how to work with overlayroot.
>> 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 of these 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

And 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 leave a list with some of the meta-packages available in Debian.

  • 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.
### 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
  • 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 such distributions, such as Fedora rawhide, Arch Linux, Gentoo, etc.

Troubleshooting

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.

We guess that it could be related to DBus, so it can be something that Distrobox can resolve (definitely, it isn’t a bug caused by 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 something related to systemd and how it handles users since the container, unlike Nitrux, will include systemd (if that’s what the distribution uses.)

We’re basing our tutorial on this tutorial by the Distrobox developer, so, again, it is referred to as an “EXPERIMENTAL” capability of Distrobox.


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

guest

4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments