How to run an Arch Linux app on Linux Mint with Distrobox

Endrit Qerreti

Endrit Qerreti

Distrobox is a tool that allows you to create containers of any Linux distro on your system.

Let's say you are using Linux mint as your main Operating system on your machine, and you want to run an Arch Linux app, to achieve this we are going to use distrobox, distrobox will create a container of Arch Linux on Linux mint, so then we can install and run any Arch linux app on Linux mint easily.

Distrobox uses podman and docker for creating containers, it is easy to install and use. In this tutorial, you will learn how to install Distrobox on Linux mint, and how to install a software on Distrobox.

If you have been switching distros because you couldn't run an app, you don't have to anymore, with distrobox you can run any Linux distro inside your system, basically it's like having multi linux distros on your terminal.

Step 1 - Update your system

It's necessary to update your system to make sure that you won't have any conflicts when installing Distrobox.

sudo apt update

Step 2 - Install Distrobox

Once you have updated your system, you can now install Dristrobox. Run the command below to install Distrobox

curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local

💡
Note: The command above will install distrobox without needing sudo permission.

You will see the following output on your terminal once distrobox has been installed on your system

Checking dependencies...
 Downloading...
 Unpacking...
 Installation successful!
 Shell scripts are located in /home/user/.local/bin
 Manpages are located in /home/user/.local/share/man/man1

Step 3 - Install podman

Distrobox uses podman or docker to create containers. So, you need to install either of them in your system, in order to be able to create containers with distrobox. We are going to install podman for this tutorial. Simply run the command below

sudo apt install podman

Output

owlhowto@owlhowto:~$ sudo apt install podman
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libdbi-perl libecap3 linux-headers-5.15.0-73 linux-headers-5.15.0-73-generic
  linux-image-5.15.0-73-generic linux-modules-5.15.0-73-generic
  linux-modules-extra-5.15.0-73-generic squid-common squid-langpack
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  buildah catatonit conmon containernetworking-plugins crun fuse-overlayfs
  golang-github-containernetworking-plugin-dnsname
  golang-github-containers-common golang-github-containers-image libslirp0
  slirp4netns uidmap
Suggested packages:
  containers-storage docker-compose
The following NEW packages will be installed:
  buildah catatonit conmon containernetworking-plugins crun fuse-overlayfs
  golang-github-containernetworking-plugin-dnsname
  golang-github-containers-common golang-github-containers-image libslirp0
  podman slirp4netns uidmap
0 upgraded, 13 newly installed, 0 to remove and 6 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 109 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Step 4 - Create a container

Now that distrobox and pod are installed on our system, we are going to create a container called "owlhowto_arch_linux"

To create a container with distrobox use the command below

distrobox-create --name owlhowto_arch_linux --image docker.io/library/archlinux:latest

--name - Allows you to set the name for the container

--image - Allows you to specify which linux distro image to use

When installing Arch linux image for the first time, you will get prompted with "Do you want to pull the image now?" , you need to press Y to confirm so that Arch linux image gets downloaded

Output

Trying to pull docker.io/library/archlinux:latest...
Getting image source signatures
Copying blob b3910bd92483 done  
Copying blob 8afbd7dc1c1d done  
Copying config 6038e9f930 done  
Writing manifest to image destination
Storing signatures
6038e9f9308080e7d0696ecd1397e29337e5d41aa090559f81c40c165f324a4f
Creating 'owlhowto_arch_linux' using image docker.io/library/archlinux:latest	 [ OK ]
Distrobox 'owlhowto_arch_linux' successfully created.

If the image has been downloaded already, then you won't need to confirm anything, and container will get created as shown in the image below

Let's now verify that the container has been created successfully and that it is appearing under the containers list. To view all containers, we can use the ls option on distrobox

distrobox ls

Once you run the command above, you should see all containers that you have created, in our case we have only one container created

As you can see the container owlhowto_arch_linux is up and running

Step 5 - Install a software on Arch linux container

First we need to enter into the container that we created, so we can install a software on Arch Linux. The syntax of entering into a container is as below

distrobox-enter owlhowto_arch_linux

Once you login in the container, container will download basic packages that are necessary to make Arch linux container work, so you should see the following output

This means that the Arch Linux container is ready to use, and now we can move to the next step to install a software on our container

First you need to make sure that you are logged into the container that you created and not on your system. Let's check the os-release information by running the command below

cat /etc/os-release

You should see the following output on your terminal

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
VERSION_ID=20230702.0.161694
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

This means that we are logged in into Arch Linux container, and now we can proceed to install a software. We are going to install a package called neofetch, neofetch is a simple tool that displays information about the system where you run it.

Now since we are going to install neofetch on Arch Linux, we need to use pacman, pacman is the package manager on Arch Linux

sudo pacman -S neofetch

Output

Confirm the installation by pressing Y

Once neofetch has been installed on our Arch Linux container, we can run it with

neofetch

And you should see a similar output

💡
Note: If you want to logout from the container, you can do so by using the exit command

exit

As you can see in the image above, the hostname changes from owlhowto_arch_linux.owlhowto to owlhowto, this means we logged out from Arch Linux container

Step 6 - Export installed software

We installed neofetch on Arch Linux container, and we can use this tool once we login in our container, but how can we run the same app on Arch Linux from the applications menu on Linux Mint? The export option allows us to do this, we can run any app we install on our Arch Linux container as if it was installed on our system Linux mint.

To do this, run the command below

distrobox-export --app appname

Replace: appname with the name of the app that you installed. For example, we are going to install visual studio code on Arch Linux, and add visual studio code on Applications Menu on Linux Mint

distrobox-export --app code

Once you run the command above, you should see the following output

And, the visual studio code icon should also appear on the applications menu. As you can see in the image below, we have two versions of visual studio code. One which is installed on our main system Linux mint (the host system) and one which is installed on our Arch Linux container.

Step 7 - Manage containers

Now that you know how to create a container on Distrobox, let's go through the process of managing a container

Stop a container

To stop a container that is running run the command below

distrobox stop container-name

Remove a container

If you want to delete a container, you can do so by using the rm option

distrobox rm container-name

List all containers

To view all containers, run the command below

distrobox ls

Upgrade a container

The upgrade command on distrobox allows you to upgrade the container's system by using its package manager. For example, if we run the upgrade command in our Arch Linux container, it will execute sudo pacman -Syu

distrobox upgrade container-name

Conclusion

In this tutorial, we explained step by step how to Install distrobox, how to run Arch Linux inside Linux Mint, and also how to Install and run an Arch Linux app on Linux mint 21.1.