Distrobox is Awesome

What is Distrobox?

Distrobox is a project that I learned about a few months ago from Fedora magazine.

Distrobox is a piece of software that will allow you to run containerized terminal and graphical-based applications from many Linux distributions on many other Linux distributions.

For example:

  • You can run applications from Arch’s AUR on openSUSE.
  • You can run applications from .deb files that are only available for Ubuntu on Fedora.
  • You can run applications from an old version of Debian on a current Manjaro system without fighting with dependency hell.
  • You can even run entire desktop environments on operating systems that never supported them.

Because the applications are running in containers, they do not interact with the base system’s package management system.

How have I been using Distrobox?

When I started using Distrobox, I started wondering what are the limits of what I could do with this system? I was able to install my favorite Usenet newsreader, Knode from Debian 8, and openSUSE on whatever system I wanted. It opened whole new doors for experimenting with software that may be long forgotten.

Could I run a simple windows manager like i3, Sway, or IceWM in Distrobox? It took some trial and error, but yes I could.

Now, with that said, we are working with containers. When you run an application in Distrobox, it mainly sees your actual home directory. Outside of your home directory, it sees the container’s filesystem. If you save something to your home directory, it gets saved to your real home directory and you can open it up like you could normally. If you save something to /usr/local/ or any other directory outside of your home directory, it will only be saved in the container and not to your actual base filesystem.

Let’s take that one step further. Let’s say I MATE as my base openSUSE desktop environment and I have 3 containers with other desktop environments. I have an Arch Distrobox container with i3, I have a Fedora Distrobox container with XFCE, and I have a Debian Distrobox container with IceWM. I can run applications from any of these containers on the base openSUSE MATE installation. However, I can’t run applications from Fedora on Debian or from Debian on Arch, etc. That’s the limitation with running these containers.

How do I run Windows Managers and Desktop Environments?

As I said earlier, this took a fair amount of trial and error to get this right, and I’m sure there are lots of things that could make this easier.

For instruction on actually installing Distrobox, check out the installation instruction page. This will vary depending on your Linux distro.

Let’s begin by installing the IceWM window manager in a Distrobox container. We’ll start with an Ubuntu container:

Create and enter the container:

distrobox-create ubuntu --image docker.io/library/ubuntu
distrobox-enter ubuntu

Now that we’re in our new Ubuntu container, let’s install IceWM. This where things start getting difficult. Even if you’re a pro at installing packages in Ubuntu or Debian, it can be really difficult to understand what exactly you need to install. My suggestion is to start with the wiki for your distro of choice for the window manager to desktop environment that you’re trying to install.

According to the Ubuntu Wiki for IceWM, we need to install package for the base installation:

sudo apt-get install icewm

This will take some time to complete depending on your hardware.

Next, we need to see how to start IceWM. Part of the IceWM installation is the creation of /usr/share/xsessions/icewm-session.desktop. This is what tells your display manager how to start IceWM. Inside of this file is a line that says:

Exec=/usr/bin/icewm-session

This is the command that we will need to start IceWM. Let’s copy that file to our home directory and then use it again in a minute:

cp /usr/share/xsessions/icewm-session.desktop ~/

We can exit out of the container for now and work in the base OS:

exit

The way we run applications from inside of the container in our base OS is with the distrobox-enter command:

/usr/bin/distrobox-enter -T -n [container] -- "[app]"

This command would run the [app] application from the [container]. However, you can’t use this command in a desktop file like the icewm-session.desktop files that we saved earlier, so we need to make one more step to create a bash script to do this for is:

#!/bin/bash
xhost +SI:localuser:$USER
/usr/bin/distrobox-enter -T -n ubuntu -- "icewm-session"

xhost +SI:localuser:$USER will allow graphical applications to be run from containers only for the current user. Without this, the icewm-session application could not start.

Save that in /usr/local/bin or some other location in your path and make it executable with chmod.

sudo chmod +x /usr/local/bin/icewm

In the icewm-session.desktop file that we saved earlier, we can change Exec=/usr/bin/icewm-session to Exec=/usr/local/bin/icewm and then save it to the /usr/share/xsessions on our base OS:

sudo cp ~/icewm-session.desktop /usr/share/xsessions/icewm-session.desktop

Now when log out, you should see IceWM as an option in your display manager. When you log in with it, you will be in the Ubuntu container. Even if you are not running Ubuntu as your base OS, you will be like you did.

Summary

Distrobox is an amazing tool and I plan on using it as much as I can.

IceWM is probably not many people’s desktop of choice, but it is small, light on resources, and easy to get going. Take this as a sample of how you can use Distrobox to be so much more than just running applications. You can try our whole new Linux distros without fussing with VMs or changing your current distro.

The Wonders of Modern Life

Last Friday, my wife and I packed up our car and drove 9.5 hours south from Prague, Czech Republic through Austria and Slovenia to a small coastal town in Croatian on the Adriatic sea. We used the Waze app on my Android phone for guidance all the way there. We stayed in an Airbnb that I found online. On the way to Croatia, we stopped outside Saltzburg, Austria for lunch. Just outside of Ljubliana, Slovenia, we topped up on diesel and had a drink and a short break.

On Saturday, we drove 90 minutes to Trieste, Italy. Except for a small problem where I put the wrong address into the Waze app, we drove to the Miramare castle parking lot through the narrow Italian streets in my big (by Italian standards) SUV. Afterward, we looked for a shopping center in Trieste where we could buy some wine and gifts for family and friends back in Prague. I found one on Google and we were there 15 minutes later.

On Sunday, we went to the Roman coliseum in Pula, Croatia. Pula is about 90 minutes away in the opposite direction from Trieste. It seemed to be a popular tourist location even on a major holiday. Parking was a bit rough but not unbearable. In truth, understanding how to use the parking meter was the only time where we had much of a problem concerning language on the entire trip.

I am blessed and privileged to fluently speak the language that is the lingua franca of much of the world today. Yet for all of my adventures on this short vacation, I can say if I didn’t speak English, but still had a relatively good understanding of technology, the difficulty level of this trip would not have been substantially greater. This is a great wonder of modern life. In previous decades or centuries, journeys like this would be rare and would require much more bravery. This was true even 50 years ago with a car.

This freedom to travel far and wide is made possible by technological innovation. I used an app on my smartphone to provide reliable verbal directions to a small village that I had never heard of before. I used a website on my computer to find an apartment for rent which I paid for online. I used a search engine on my phone to get a conversion rate on my money. I used ATMs from banks I never heard of to get Euros and Croatian Kuna that were programmed in 4 to 5 different languages. These are all things that have never been possible in the past.

We live in amazing times. If we ever lost all of this, it would be a tragedy and because of that, I don’t want to take it for granted. We can’t assume that this progress will still be here tomorrow or next year. It can be taken away. We can regress.

DAPS in a Container

DAPS is OpenSUSE’s “DocBook Authoring and Publishing Suite” that is used to build documentation for SUSE and OpenSUSE. It actually requires A LOT of dependencies when being installed and for that reason alone, it’s actually better to run it in a container. This is my image and how I use it.

docker run -v ~/myproject/:/home/user jsevans/daps:latest daps -d DC-project epub

Command Breakdown:

docker run – Run the command in the container:

-v ~/myproject/:/home/user – Maps a local directory called ~/myproject to a directory in the container called /home/user. /home/user is the default directory that is used by the daps command, so it is best to map this directory rather than needing any extra command line components.

jsevans/daps:latest – This is the image that I’ve created. It is based on OpenSUSE Tumbleweed but it is stable enough for this use. However, it is a large image ~1.2GB due to the number of dependencies.

daps -d DC-project epub – This is the actual command line argument for creating an EPUB ebook using DAPS. I use Asciidoc as my markup language since I don’t really want to learn docbook.

My Dockerfile:

FROM opensuse/tumbleweed
MAINTAINER Jason Evans <jsevans@opensuse.com>

RUN zypper refresh
RUN zypper --non-interactive in daps git

ENV HOME /home/user
RUN useradd --create-home --home-dir $HOME user \
&& chown -R user $HOME

WORKDIR $HOME
USER user

CMD [ "/usr/bin/daps" ]

What would you like to see most in minix?

I’m working on a couple of presentations and I wanted to share this nugget of joy with anyone who hasn’t actually read it.

Path: gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.
ohio-state.edu!wupost!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Keywords: 386, preferences
Message-ID: <1991Aug25.205708.9541@klaava.Helsinki.FI>
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki
Lines: 20

Hello everybody out there using minix -

I'm doing a (free) operating system (just a hobby, won't be big and
professional like gnu) for 386(486) AT clones.  This has been brewing
since april, and is starting to get ready.  I'd like any feedback on
things people like/dislike in minix, as my OS resembles it somewhat
(same physical layout of the file-system (due to practical reasons)
among other things).

I've currently ported bash(1.08) and gcc(1.40), and things seem to work.
This implies that I'll get something practical within a few months, and
I'd like to know what features most people would want.  Any suggestions
are welcome, but I won't promise I'll implement them :-)

Linus (torvalds@kruuna.helsinki.fi)

PS.  Yes - it's free of any minix code, and it has a multi-threaded fs.
It is NOT protable (uses 386 task switching etc), and it probably never
will support anything other than AT-harddisks, as that's all I have :-(.

Linux newbies shouldn’t dual boot

If you lurk around many Linux support forums, you are bound to see the regular post that looks something like this:

Hi, I’m new to Linux. I tried to dual boot Windows and Ubuntu, now I can’t use my computer at all because it has errors. Help!!!

Troubleshooting Grub errors is difficult enough. Troubleshooting Grub errors when you know very little about how any of it works or when getting help from strangers on the internet is even more difficult to nearly impossible.

I offer 3 suggestions for newbs who want to learn Linux other than dual booting.

  1. Use a virtual machine. Download Virtualbox on any platform, and install Linux there. It is a little slower than a real computer, but it is safe. If something breaks, nothing is lost. Just start again.
  2. Use bootable live installations. OpenSUSE, Ubuntu, and others allow you to use their Linux distribution from a USB key without ever installing it. This is faster that a VM and when rebooted, it’s like it was never there.
  3. Get a dedicated Linux machine. I’m not talking about spending a ton of money on something new. A raspberry pi will do nicely. So would an old machine from Craigslist. Something that would be used only for Linux and that’s all.

All of these are safe alternatives. I suggest the first option though because it costs nothing except time and your data will be safe.

Proposing a new newsgroup: Internet History

I am thinking about making a formal proposal for one of two new
unmoderated groups. The group would either be comp.internet.history or
soc.history.internet. I think you can see where these two names could
possibly overlap.

The general idea of the new group is to discuss retro internet
technologies such as IRC, ftp sites, BBSs (telnet and otherwise), MUDS,
MOOs, and of course Usenet and others. We could also discuss the culture
that surrounded many of these technologies especially IRC and Usenet as
they were maturing. Many of use don’t consider these technologies to be
“retro” because we use them everyday and yet interest in them is waning
and in order for them to continue, fresh interest must be continually be
added.

I don’t know if anyone could possibly be interested, but the only way to
find out is to ask. If I get enough positive feedback, I’ll write up an
official CFD and submit it to the board. I won’t do anything if no one is
interested.

Why Stack Exchange is Broken (and Reddit too)

I’m going to begin this rant by saying that there are some things that that the Stack Exchange network is really good with: mainly, programming help.

However, it really sucks when it comes to providing help with a specific application where there is already a community. For the past year, I have been the #1 person to answer questions on tor.stackexchange.com. I’m not saying that to pat myself on the back; just to say that I have actually been doing this for a little while. However, I feel that many, if not most, of the questions should never have been there. Here’s what I mean:

  1. Nobody googles anything for themselves anymore. A huge number of questions have been answered time and time again and can be found by just searching.
  2. Nobody reads documentation or man pages.
  3. There are better places to ask the questions.

While #1 and #2 are annoying, it’s #3 that I want to focus on. For example, we get a lot of questions about running Tor relays. Many times, I will copy and paste from the documentation and answer their question. However that question should never have been there at all. It should have been posted to the tor-relays mailing list. That way more people who actually run relays can answer and give better insight. Also other newbies to the list can learn also and the person asking the question can actually be a part of the community.

When it comes to subreddits that are based on a specific application like Tor, take my 3 examples and multiple it by 1000x because it is a continual cycle of the same crap week after week. I had to leave before I flamed someone for asking the same stupid question for the 9th time in a row. I miss good netiquette.

Announcement

From news.groups.newgroups:

This is an official communication from the Big-8 Management Board. Please note that followups are set to news.groups.

After a careful review of the Big 8 Management Board’s activity and process, all remaining members of the Big 8 Management Board opted not to consider re-election and instead have voted to install two new volunteers as the new members of the Big 8 Management Board. These two volunteers are:

Tristan Miller Jason Evans

We believe these volunteers have the technical and social skills necessary to maintain the Big-8. Please give them your support while they develop their vision for the future mission and goals of the Big 8 Board.

Kathy Morgan, Chairperson Emeritus Bill Horne, former Chairperson