Jump to content

Distrobox, Quickly & Easily Fire Up Different Distros On Your System.


abarbarian

Recommended Posts

abarbarian

Distrobox 1.3 Released For Quickly & Easily Firing Up Different Distros On Your System

 

Quote

Distrobox is self-described as, "Use any Linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Distrobox uses podman or docker to create containers using the Linux distribution of your choice. The created container will be tightly integrated with the host, allowing sharing of the HOME directory of the user, external storage, external USB devices and graphical apps (X11/Wayland), and audio."

 

89luca89 / distrobox  project home page. There is a video on the page which is well worth a look.

 

Quote

What it does

Simply put it's a fancy wrapper around podman or docker to create and start containers highly integrated with the hosts.

 

The distrobox environment is based on an OCI image. This image is used to create a container that seamlessly integrates with the rest of the operating system by providing access to the user's home directory, the Wayland and X11 sockets, networking, removable devices (like USB sticks), systemd journal, SSH agent, D-Bus, ulimits, /dev and the udev database, etc...

 

It implements the same concepts introduced by https://github.com/containers/toolbox but in a simplified way using POSIX sh and aiming at broader compatibility.

 

All the props go to them as they had the great idea to implement this stuff.

 

Distrobox has been successfully tested on these hosts

 

Distrobox guests tested successfully with the following container images:

 

distrobox/docs/usage  well worth a read before using

 

distrobox/docs/useful_tips  well worth a read before using

 

From my reading it seems easiest and safest to use distrobox with rootless Podman on a personal pc. If using on a remote pc extra care and steps must be taken for security.

 

Quote

When using podman, distrobox will prefer to use rootless containers. In this mode the root user inside the container is not the real root user of the host. But it still has the same privileges as your normal $USER.

 

Quote

warning BE CAREFUL: if you use docker, or you use podman with the --root/-r flag, the containers will run as root, so root inside the rootful container can modify system stuff outside the container, if you have security concern for this, use podman that runs in rootless mode. Rootless docker is still not working as intended and will be included in the future when it will be complete.

 

https://wiki.archlinux.org/title/Podman#Rootless_Podman

 

Quote

Rootless Podman

Warning: Rootless Podman relies on the unprivileged user namespace usage (CONFIG_USER_NS_UNPRIVILEGED) which has some serious security implications, see Security#Sandboxing applications for details.

By default only root is allowed to run containers (or namespaces in kernelspeak). Running rootless Podman improves security as an attacker will not have root privileges over your system, and also allows multiple unprivileged users to run containers on the same machine. See also podman(1) § Rootless mode.

 

There are  AUR offerings for distrobox and distrobox-git. The "distrobox" offering is the most recently updated.

 

https://aur.archlinux.org/packages/distrobox

 

This looks to be a super project and pretty safe to use if using on your own pc. For instance I could use it with Arch in a container, fiddle about with it to destructin and not cause any damage to my main install.  😜

  • Like 1
Link to comment
Share on other sites

securitybreach

Although, this part makes me nervous:

 

The created container will be tightly integrated with the host, allowing sharing of the HOME directory of the user, external storage, external USB devices and graphical apps (X11/Wayland), and audio."

 

Using the same home directory with multiple distros can cause some major issues due to different versions of packages and such writing their configs to HOME.

  • Like 1
  • +1 1
Link to comment
Share on other sites

abarbarian
1 hour ago, securitybreach said:

Although, this part makes me nervous:

 

 

 

 

Using the same home directory with multiple distros can cause some major issues due to different versions of packages and such writing their configs to HOME.

 

That is why reading the helpful tips is useful.

 

Quote

Create a distrobox with a custom HOME directory

distrobox create supports the use of the --home flag, as specified in the usage HERE

Simply use:

distrobox create --name test --image your-choosen-image:tag --home /your/custom/home

 

RTFM all the time 😂

Link to comment
Share on other sites

securitybreach
6 minutes ago, abarbarian said:

 

That is why reading the helpful tips is useful.

 

 

RTFM all the time 😂

 

 

While it may not mess up the host, the same issues would apply with mixing distros with same home. Its just asking for breakage.

Link to comment
Share on other sites

abarbarian
16 hours ago, securitybreach said:

 

 

While it may not mess up the host, the same issues would apply with mixing distros with same home. Its just asking for breakage.

 

I do not see why.

 

You have a host pc with it's own home and root, then you have a distro running in a container with it's own home and root, never the twain shall meet unless you specifically tell them to. Any changes you make to the visitor stay within the visitors file system.

Can you expand your reasoning a little ? 😎

Link to comment
Share on other sites

securitybreach
1 hour ago, abarbarian said:

 

I do not see why.

 

You have a host pc with it's own home and root, then you have a distro running in a container with it's own home and root, never the twain shall meet unless you specifically tell them to. Any changes you make to the visitor stay within the visitors file system.

Can you expand your reasoning a little ? 😎

 

The shared HOME between the distros is the problem, not where it is located. It may not mess the host up but it will break the distros as time goes. It's a neat project though.

Link to comment
Share on other sites

securitybreach

The distros may have different versions of the installed software, meaning that their settings might not be identical. It should normally not be a problem since the applications should handle different versions properly, but not all do

Link to comment
Share on other sites

abarbarian
3 hours ago, securitybreach said:

 

The shared HOME between the distros is the problem, not where it is located. It may not mess the host up but it will break the distros as time goes. It's a neat project though.

 

As I read it you can create a separate "home" for the container on the container which separates it from the host "home".

 

This is a tad confusing as from my reading you can install several different versions of a program and use them. Also you can install a Fedora/Ubuntu/etc program with a container and use from the host which may be Arch/etc.

 

https://fedoramagazine.org/run-distrobox-on-fedora-linux/

 

Quote

Installing an old or unavailable application

What if you need specifically an old application on your new system? You really need that good old deb from 2014 and there is no Flatpak available? You can resort to Distrobox:

luca-linux@x250:~$ distrobox-create --name old-ubuntu --image ubuntu:14.
luca-linux@x250:~$ distrobox-enter --name old-
luca-linux@old-ubuntu:~$ sudo dpkg -i ./that-old-program.
luca-linux@old-ubuntu:~$ distrobox-export --app that-old-program
luca-linux@old-ubuntu:~$ distrobox-export --bin /usr/bin/that-old-program --export-path ~/.local/bin

Now you have your vintage environment and install that old deb package you have found online without messing around with alien, old glibc, or littering your main operating system.

This is also handy for apps that are not rpm-packaged and do not offer a Flatpak.

 

 

There does not seem to be a great deal of articles regarding this particular query on the net. I'll keep reading up on it though.

 

I did fine this article on how to use different Window Managers and Desktops with Distrobox which is informative.

 

Distrobox is Awesome

 

Quote

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.

 

 

Quote

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

 

This is what interests me as I want to fiddle around with Window Maker without crippling my main Arch.

 

I recon the only way to find out what is going on is to install a dual boot with anothe rArch system and try out Distrobox on that. I have a USB 3 enclosure with my old nvme drive in it which should be big enough for the job and fast enough too. I will not need a lot of extra programs as I just need Window Maker and a screenrecorder to fiddle around with. Hmm can I find the time ? 🤔

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...