TL;DR: It’s basically a WSL for Linux. Linux subsystem for Linux if you will.
It let’s you install and use pretty much any software ever written for Linux, including AUR packages and graphical apps, on any distro you want. You should all give it a try!
Distrobox is probably the best thing ever.
If bread existed in the Linux world, Distrobox would be the equivalent, or better than sliced bread.
It just solves many of the problems that plagued us in the past!
I’m just sick of answering so many comments or posts where people either
- almost dislocate their joints in trying to get some software working on their distro, where it isn’t officially supported;
- or choose/ leave a particular distro based on the amount of available packages, e.g. Arch.
**The answer is simple: use fucking containers. **
Before I turned into a weird “immutable distro”-user, I slapped every random install onto my host OS.
After all this shit building up over years, and cluttering my system, it turned against me.
Repos not being available, packages conflicting, weird icons popping up, and more. It was a mess!
If one did that on a server, he would probably get slapped by the Selfhosted-community.
If there’s Docker, Podman and more, especially for servers, why don’t we use it for desktop too?
Some guy probably thought the same and made Distrobox.
You can just download BoxBuddy as Flatpak and/ or install it via package manager.
BoxBuddy is a graphical frontend, that helps you manage and use your containers. It’s pretty new tho and is still in heavy development.
Traditionally, Distrobox is CLI-only, but I can see that changing in the near future.
“Why not just use a VM?”
Those containers aren’t isolated and barely draw additional resources. Actually, they’re somewhat comparable to Flatpaks.
They provide themselves with their stuff they need, but aren’t virtualized. The main difference between Flatpaks and DB-containers for myself is that Flatpaks have permissions.
They can and will interact with your host. For example, if I plug in my phone, I can access it via ADB in my Arch container. Or my Nextcloud-client can open my browser and auto start on boot.
Who needs that?
Everyone. Well, maybe. Depends.
Image distros
Certainly users of image based (“immutable”) distros like Fedora Silverblue and other variants of this family, like uBlue (Bazzite, etc.).
While we actually could install every package from the Fedora repo traditionally on our host, this should be avoided.
Steam Deck users would benefit strongly too, since they can only use Flatpaks atm.
People who can’t get some packages with their distro
One of the main arguments, why so many users go or stay on Arch, is the AUR.
Often, they have a love-hate-relationship with it. It might break easily if you do something wrong, which is easily done for many users. At the same time, it gives them their niche software they need.
What if I told you, that you can enjoy this huge plus point for Arch on every other distro too, while benefiting from the comfort of your favourite distro?
You can even install an Ubuntu container and use Snaps there if you enjoy using them.
Developers
On the stock Fedora Silverblue, there’s Toolbx pre-installed, which does something very similar, but not as good. It’s a RedHead product.
On uBlue on the other hand, Distrobox is the default, which is better.
Toolbx’ main use case is programming. For devs working with different Python-versions for example and don’t wanna risk breaking their OS.
DB does the same, but more.
But why is it so powerful?
You can also export your software to your host.
E.g., the Flatpak version of Nextcloud didn’t work well for me. The Arch package on the other hand is less buggy and looks properly.
It’s perfectly integrated in my system and I don’t notice it at all that it hasn’t been installed natively.
This even extends to DEs and TWMs!
You could, for example, create an Arch container only for Hyprland, which you basically can’t install on other distros.
And then, you can use said example, or the beta-version of the new Plasma, on OpenSuse Leap.
On uBlue at least, all my containers update themselves too.
Another great thing is the modularity.
You can, for example, just delete the Arch container if it breaks randomly or due to user error, without worrying about losing access to your PC or having to troubleshoot for hours.
All in all, just try it. Trust me.
You should check out Nix the package manager, which is an even better option than Distrobox if you want to install stuff independently of your distro’s packaging system. The biggest advantage of using Nix is that there’s no container layer, so you’re running the binaries directly on your host OS - this means that the binary can have full access to system resources, which is handy if you need to run one of those apps with root privileges (try running a Distrobox exported app with
sudo
- it won’t work). Or say you want to install something like a terminal emulator - it’s not exactly practical to install it inside Distrobox, because now every time you run the terminal, you’d be viewing at your system from inside the container, which can makes things pretty messy.Another advantage of Nix is that because you’re dealing with actual binaries and not just a shim script, it can handle command line arguments properly and also handle things like stdin/stdout properly. In fact there’s a bug right now with the way Distrobox export handles command line parameters, where it eats some of the parameters so your exported program may not work correctly. I had this issue with a Distrobox export of freerdp and raised an issue for it, but it still hasn’t been fixed. So until this is fixed, I’d advise staying away from running distrobox exported stuff, unless you’re using it for only simple apps/workflows.
Also, you don’t have the hassle of having to maintain/update the Arch or whatever OS is installed inside your containers.
Finally, with Nix you can easily roll back your transactions or switch between multiple versions of the apps - all of which takes place instantly, because all it’s doing is switching the symlinks in the Nix store.
With Nix you have to do everything the Nix way. If a package doesn’t work correctly or is missing you either have to dive deep into the Nix rabbit hole or wait till someone who knows stuff fixes your problem. With nix everything is all or nothing (even more so with NixOS).
Distrobox is the opposite, it embraces variety and gives you as many options/distro environments as it can. Once the missing container bugs are fixed you are dependent on no one to get your packages working.
Also, Nix is usually not the normal way devs package their software, so there always have to be people repackaging the stuff with nix (and updating when the source package changes).
Distrobox gives you access to the environment where the stuff is packaged already, a lot less work is needed to get working packages which should not be underestimated.
The more packages you install with nix the higher the probability you encounter packages no nix expert has cared for recently
lots of softwares are missing in nix. distrobox with AUR is the best and safest option
Any examples of what’s missing exactly?
deleted by creator
yeah, that is why distrobox is lot of more flexible than nixos and hell even SteamOS support distrobox natively as well.
I just use distrobox on NixOS.
Why not switch to NixOS and run Duplicacy in an Arch Distrobox on top?
The whole point of Distrobox is the you want access to the package manager ( well, the packages ) of a different distribution.
Yes, but if that’s all you’re after then it’s overkill, because Nix (probably) has all the packages you’d want. Unless that distro you’re after has a special/unique package that’s not found anywhere else or something.
According to Repology, Nix has around 90,000 packages, compared to AUR’s 75k. Of course those numbers aren’t exactly comparable given the loose definition of a “package”, but it should be a rough indicator that surely you can get almost anything you want from Nix, without running into the limitations and complexities of Distrobox.
they unironically say in comparison to the arcane language of fucking Nix, lmao
I was referring to the use of Nix the imperative way, as opposed to declarative which requires writing a config file. In the imperative way you can install/upgrade/uninstall packages with just a single command, similar to other package managers.
Eg:
nix profile install nixpkgs#tealdeer
-> installs tealdeer from the nixpkgs repo.I’ve been using Nix to install stuff this way on my immutable OS for about 6 months now this way and haven’t had any issues. And it’s fast. Like, even faster than pacman, which is one of the things I like about it.