Distrobox

Jump to: navigation, search

Distrobox is a tool for providing containerised runtimes of several different Linux distributions.

It is particularly interesting for users of immutable Linux (eg. MicroOS) where it can provide a read-write userspace so new tools can be installed without needing a reboot. It's similar to other tools such as 'toolbox' (which is included on the server version of MicroOS by default), but has some other advantages for desktop usage. Please refer to https://github.com/89luca89/distrobox for all options.

Quick Start

MicroOS

Distrobox is already installed on MicroOS Desktop machines, else you need to install the distrobox package first

Create and open a default tumbleweed environment with:

  $ distrobox enter

Leap and Tumbleweed

Leap does not come with preinstalled Distrobox therefore users have to install it manually. In case of Docker your user should be in the group docker, otherwise, you'll receive following error permission denied while trying to connect to the Docker daemon socket.

 $ sudo zypper install distrobox # pulls in docker by default
 $ sudo groupadd docker; sudo usermod -aG docker $USER # you should re-login with the user for changes to take effect
 $ sudo systemctl enable --now docker
 $ distrobox enter

Distrobox For Packagers

openSUSE has a customised distrobox-ready container image for use by openSUSE Packagers, Release Managers and such. In addition to being really useful for MicroOS Desktop users, it may also be of interest to users of Leap or other non-openSUSE Distributions.

This distrobox already has all the following tools installed and ready for use

  • osc
  • git
  • build
  • vim
  • many osc service plugins (eg tar, tar_scm, obs_scm, recompress, go_modules, etc)
  • osc staging, cycle and origin plugins
  • opensuse-release-tools

To create a distrobox using this image run:

  $ distrobox create --root --name tumbleweed-pkg --image registry.opensuse.org/opensuse/distrobox-packaging:latest

NOTES:

  • --root is optional, but needed if you want to use features like `osc build`
  • --name can be whatever you want your distrobox name to be, just be sure to substitute whatever you use instead below also

Please make sure to use distrobox enter --root in case you've used --root during creation, otherwise you would create a brand new distrobox.

To enter the distrobox run

  $ distrobox enter tumbleweed-pkg


Distrobox export

With distrobox-export you can create a shortcut in your host system to open an application from a distrobox container. So, in this example, if you want to export a desktop (GUI) app you installed, enter the distrobox of your choice and enter the following (as a regular user, not as root):

  $ distrobox-export --app <name of the app>

This will populate your user's directory with the corresponding .desktop file, the icon, and a link placed in ~/.local/share/applications/ to populate the user's menu as if the application was 'normally' installed.

/* It isn't clear to me if the "binary" referred to on the github page below are console apps, libraries, or data as "binary" is a smidgen vague. Perhaps someone who has done this can elaborate and clarify. */

To learn more about additional flags and how to export other apps that require services (e.g. syncthing), visit | export man pages.