Distrobox with BoxBuddy on openSUSE

With immutable Linux distributions becoming a more in vogue these days and the likes of Blend OS and Nix OS giving you incredible package flexibility, I was starting to feel a little left out of all the fun that everyone was talking about. Also, to keep in tradition of being months to years behind everyone else on the new and shiny toys, here we go.

Bottom line up front: I have gone from turning this into a technical curiosity to a functional tool to better compartmentalize my computer as an improvement to my digital work environment. It also adds functionality previously only attainable through VMs or bare-metal installation. I can get all the Linux love out there on one machine.

Installation

There are two parts to this, Distrobox the system and BoxBuddy the interface. BoxBuddy is not explicitly required for a successful experience but it makes the whole process much easier.

Distrobox installation:

sudo zypper install distrobox

BoxBuddy is a Flatpak so you will have to be sure that Flathub is already set up.

https://docs.flathub.org/docs/for-users/installation

Then install BoxBuddy

flatpak install flathub io.github.dvlv.boxbuddyrs

BoxBuddy does need one tweak that can easily be done in Plasma Settings or using Flatseal to adjust permissions with access to the user files.

Now BoxBuddy has the permissions to access the user files so that it can create and manipulate the Distrobox containers.

Two additional steps are required if you have not already set up Docker on your system. First you need to add your username to the docker group:

sudo usermod -aG docker $USER

Next, you will have to start and enable Docker.

sudo systemctl start docker
sudo systemctl enable docker

It is required that you reboot your machine for the docker permissions to take hold. For everything else it seems that you can just log out and log back in but that doesn’t seem to be the case with Docker on my testing.

Now you should be all set with using Distrobox and BoxBoddy along with all the glorious functionality it will bring to you.

Create Distrobox Container

For a terminal tutorial, there is a great step-by-step here which works very well. There is a quickstart that breaks the steps down. This is where I started before BoxBuddy. This is also great to go through if you plan to do anything a bit more advanced.

https://distrobox.it/#quick-start

I would like to focus here on BoxBuddy because this is a super cool application for managing your various Distro Boxes.

As you can see, I have been playing with this quite a bit…

To create a new Distrobox, click on the “+” in the upper-left corner.

There you can select a distribution of your choice in the list. For this example, I am going to install Kali Linux. I have always wanted to have those tools readily available for me to use the fun security tools but not have to spin up a whole VM or set a dedicated machine for this.

I don’t see a need for me to use an init system but keep in mind, if you do have an application that depends on an init system, you should toggle this option.

I left the home directory blank so that it just uses my default home directory. It is easy to set up the home directory of your choice for your specific purposes. I can see many instances where this would be the preferred way to go.

Arguably, it might be better to completely separate out the home directory but for my purposes, I want it all merged together.

Open Terminal

With just a click, you can go right into a terminal on your Distrobox instance by clicking on Open Terminal within BoxBuddy or alternatively, open a terminal and enter this:

distrobox enter Kali

There is no real difference between the two at all except you do get a neat little icon next to the prompt with the terminal way.

At first run, this will prompt you for a user password. Enter your preferred password and you are in.

I am running Kali for this “guest” or “container” or “In-this-distrobox” and I am greeted with a message with some recommendations by the developers. Weirdly, it is repeated once but maybe they are really emphasizing it?

This is the beginning of having Now I can have all the wonderfully curated packaged Kali Linux tools running neatly on my openSUSE Tumbleweed machine. It is like the best of both or maybe all the worlds of Linux, well, at least the Linux distros that are supported as a distrobox.

Upgrade Box

From BoxBuddy, the upgrade process for the box is super slick. Just click on “Upgrade Box”, a terminal window will be launched awaiting for your sudo password to do the upgrade.

The upgrade process will commence and when complete you can proceed to close the terminal or do other fun activities.

If you have multiple distroboxes and you want to upgrade them all, this is also a slick process and also outside of the scope of the simplicity, confidence building, getting started angle I’m going for this but truly, check this out and play around with it.

https://distrobox.it/usage/distrobox-upgrade

Install Applications

Terminal management of software has really been my favorite way to interact with a Linux system. I like to watch everything it does. Make sure that there are no surprises… or at least… reduce the number of surprises.

Following the recommendations here:

https://www.kali.org/docs/general-use/metapackages

I decided to install follow along and see how well it works with Distrobox, starting with the recommended update and full-upgrade.

Then I installed the “kali-linux-default”

I then decided to install the “kali-tools-vulnerability” to do some vulnerability assessments. I also want to do install “kali-tools-reporting” because I think these patterns will give me enough to start playing around with some of the really cool Kali tools.

I find it absolutely fantastic that I am able to use the native package manager same as though I were running the distribution on bare metal or in a VM, with some exceptions of course. I may run into those on a case by case basis but are likely solvable.

Exporting Applications

What is cool here is that I am able to run an application within a distrobox as though it were native. There is this fantastic ability to be able to export an application and have it available in your menu. Crazy!

The slick way of doing this within BoxBuddy doesn’t seem to be working for me. What SHOULD happen is that when I click on “View Applications” that I get a list that I can export, run or whatnot.

So, instead, I’ll have to do it the terminal way for now. Should I find the solution to this problem (and I’ve searched extensively), I will update this portion of the article to share the knowledge. That said, if I want to export an application there is a simple way to do it, so long as you know the application’s name. For my case, I want to make available xhydra into my menu bar.

Within the Distrobox container terminal. Type:

distrobox-export --app xhydra

It will then tell you that the application has been successfully exported:

$ distrobox-export –app xhydra
Application xhydra successfully exported.
OK!
xhydra will appear in your applications list in a few seconds.

To remove the app, if you so desire, the command just needs one extra option.

distrobox-export --app xhydra --delete

And the system will let you know that it has been successfully removed.

$ distrobox-export –app xhydra –delete
Application xhydra successfully un-exported.
OK!
xhydra will disappear from your applications list in a few seconds.

That’s all there is to it. Now, if BoxBuddy was working properly, I would demonstrate that and sing the praises but I think I am missing something on the permissions front.

Delete Box

In BoxBuddy, it is very straight forward on what is required to delete the Distrobox container. Just click “Delete Box” and confirm that is what you really want to do.

Alternatively, in the terminal, you can list out the names of your distroboxes.

Then follow it with the command to delete the Distrobox by it’s NAME.

distrobox-rm Kali

Now you have thrown away all the work you have put into that Distrobox without any consequence to your host system. Really cool and frankly, a bit scary.

What I Like

For starters, when you execute the distrobox-list command in the terminal, you get a really cool color-coded view of what containers are actually running. This is neat because I can see, at a snapshot that Tumbleweed and Kali are running when I ran the list command previously. Super cool.

I can now move some more esoteric applications out of my host system and put them in a Distrobox container so that I can streamline the update process on my host computer. I have had so many community repositories added to my package manager and that can cause for some really long update times. Now, I have decided to move some of the more unique applications, like Tilp a Texas Instruments Graphing Calculator Communication application to its own Distrobox so that when I go to update my system, that is one less repo that needs to be updated and factored into the process. So far as I can tell, I have lost no functionality with the applications I have exported vs having them on the host system.

I can play with all sorts of interesting applications that were not built directly for openSUSE Tumbleweed directly. This basically means that nearly every application that is made for Linux is now available to me. I’m sure there will be exceptions to this but for the most part, it looks like that is the thing I can do. I think openSUSE provides the best desktop experience but does lack in overall application availability. Distrobox completely (nearly) eliminates that now and I can run an even leaner system than before. Oh, what times we live in!

What I Don’t Like

BoxBuddy isn’t showing me the applications available, I am sure that might be a permissions issue but it is a bit frustrating that the solution isn’t more evident. Should I find the solution, I will update this article and this portion of what I don’t like.

The Bash history doesn’t seem to be preserved on what commands I write within the Distrobox instance. Not a huge deal, it just means I need a better memory. This is probably also tunable but I have not taken the time to figure it out.

With some of the meta packages that I installed into the Kali Distrobox container, I had to take some time to figure out what was actually installed. This is more a criticism of the process but I was able to look up the list of applications installed. This is just an annoyance but sort of the reality of Linux in general.

Final Thoughts

Distrobox is super cool and very handy to use. This is going to be yet another regular part of my Linux computer setup menu item. This is more of an “advanced user” feature but it is so nice to have this right here, ready for me to use run applications in such a way that it just won’t affect how my host system operates, after the fact.

BoxBuddy make it very convenient to open and enter into the container as needed. It makes managing the system very straight forward. Perhaps most importantly, BoxBuddy is the best way to add a new Distrobox because the list of available options are right there and ready to go. Looking up a list of the various distributions and getting the name just right is kind of a pain but BoxBuddy smooths that out completely.

So, now, when someone asks if I have tried some really cool application available only on Ubuntu, Arch or something else, I can try it out and see if it is something that works for me.

Truly, this is pretty rad… perhaps even groovy…

References

BoxBuddy on Flathub
BoxBuddy on Github
https://distrobox.it/#quick-start
https://distrobox.it/usage/distrobox-upgrade/
Linking a TI-86 Calculator with openSUSE

2 thoughts on “Distrobox with BoxBuddy on openSUSE

  1. Excellent article. I followed the instructions indicated, but I can’t create any distrobox. When I select “create” the terminal opens and closes immediately without creating anything. Thanks for your advice.

    1. Thank you for contacting me on this. This, I did not encounter this because I am already running docker and have all the permissions in place. My bad.

      Two additional steps and I will fix the article accordingly:

      sudo usermod -aG docker $USER

      sudo systemctl start docker
      sudo systemctl enable docker

      You will also have to reboot your machine for the docker permissions to take place. They did not with a logout and log back in on my test.

      I hope that helps.

Leave a Reply