Like magic, Distrobox runs applications from different Linux distributions right on your Linux computer.
Theyre running on your box, yet theyre in their own native distribution.
We show you how it works.
Dave McKay/How-To Geek
The Problem With Regular Containers
Containers are a form of virtual machine.
A traditionalvirtual machinehas a complete installation of an operating system inside it.
Scripts can control their creation, use, shut-down, and removal.
Just as they are with virtual machines, theapplicationsinside containers are isolated from the host system.
Distrobox containers also benefit from hardware pass-through.
If you plug in a USB rig, for example, the container can see it too.
How to Install Distrobox
Distrobox uses eitherDockerorPodmanas the underlying container management system.
Were going to use Docker.
If you dont already have Docker on your gear youll need to install it.
Installing Docker
Docker is available in the repositories of the major distributions.
To install Docker on Ubuntu, use this command.
We create the group with groupadd command.
Docker may have created the group for you.
If that’s the case, you’ll be told it already exists.
Either way, we need to add you to that group, using the usermod command.
Youll need to sign in and out to activate your group membership.
Installing Distrobox
Installing Distrobox is even easier than installing docker.
This step requires animage file.
We can go for the image we want to use from thelist on the Distrobox website.
The list is in alphabetical order by distribution name, starting at AlmaLinux and finishing at Void Linux.
Many distributions are available in several versions.
Versions that have “toolbox” added to their name include a set of default programs.
Those without “toolbox” are lightweight images.
Were going to create an Arch Linux container.
Copy the web address for the image youre going to use, and paste it into the following command.
Were using the Distrobox create command to create a container.
The -i (image) option tells Distrobox which image to use.
The -n (name) option sets a name for the container.
It also becomes the host name for the virtual computer inside the container.
Youre prompted to download the image to your gear.
Press Y and hit the Enter key.
All the downloads we tried were surprisingly fast.
Theres some housekeeping to be performed the first time the container is launched.
On our test machine this took one or two minutes.
When youre returned to the command prompt, take a look at it.
Itll say the name of the container youve created and entered.
Youre now inside an Arch Linux container.
Running the ls command shows the home directory of our Ubuntu host computer.
But Distrobox lets us start the program from outside the container, from our host computers command prompt.
The -T (no tty) option supresses the creation of a new terminal window.
-n (name) command tells Distrobox which container to look inside for the command.
Opera is launched and runs on your desktop as though you had installed it on the host computer.
Its clear that the launched utility has access to your host computer.
The internet tool is storing its prefs on the Ubuntu host.
Other Useful Commands
To exit from a container, jot down exit and hit Enter.
Youll see the prompt return to that of your host computer.
The container is still running though.
If you want to shut down the container, use the stop command.
you should probably confirm that you really do want to stop the container.
To see which containers youve created, use the list command.
Color is used to highlight which containers are running and which are not.
you could remove, as in delete, a container with the distrobox rm command.
There’s no longer a reason to miss out on any program from any distribution.