1. Home
  2. Linux
  3. How to install distrobox to run any linux distro in the terminal

How to run any Linux distro from your terminal

Distrobox is a unique application that allows users to grab Docker images of Linux operating systems and quickly run them on Linux. This guide will go over how you can get Distrobox working on Linux.

Installing Distrobox on Linux

Distrobox is a command-line utility. It relies heavily on the terminal, and users must install it to get it working. To start the installation of Distrobox on your computer, open up a terminal window.

Unsure about how to open up a terminal window on the Linux desktop? Press Ctrl + Alt + T on the keyboard. Alternatively, search for “Terminal” in the app menu and click on it with the mouse to launch it.

Once the terminal window is open, the installation can begin. Using the installation instructions down below, set up the latest version of Distrobox on your computer.

Generic installation

The generic installation process is the best way to get Distrobox working on your Linux computer. Generic installation for Distrobox requires installing the “curl” package on your computer.

Curl should be easy to get working on a wide variety of Linux operating systems. To set it up, enter the commands below.

Ubuntu

sudo apt install curl

Debian

sudo apt-get install curl

Arch Linux

sudo pacman -S curl

Fedora

sudo dnf install curl

OpenSUSE

sudo zypper install curl

After setting up the Curl package on your Linux computer, use it to pull down the latest Distrobox script and set it up on your computer. Keep in mind that this script needs to be run as root with the sudo command so that you will need admin access to your computer.

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

Once you’ve set up the Distrobox app via the script, you’ll need a container manager app. You can use either Podman or Docker. First, however, we suggest setting up Docker. For information on setting up Docker on your Linux system, check the official website.

Uninstall Distrobox

Do you want to remove Distrobox from your Linux system? Use the script command below to uninstall it from your system.

curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/uninstall | sudo sh

Snap installation

If you wish to use Distrobox as a Snap, you can. Set up the Snap package runtime on your computer to get it working. You can get the Snap package runtime set up on your system by following our installation guide.

With the Snap package runtime set up and ready to go, use the snap install command to install the Distrobox tool.

sudo snap install distrobox --beta

With Distrobox set up, you must also configure and install Docker. For information on setting up Docker on your computer, please follow the official configuration guide.

Arch Linux installation

The Distrobox application is available for installation on the Arch Linux AUR. To get it working on your computer, start by installing the Trizen AUR helper. You can do that with the commands below in a terminal window.

sudo pacman -S git base-devel
git clone https://aur.archlinux.org/trizen.git
cd trizen/
makepkg -sri

With the Trizen AUR helper set up on your computer, you can install the Distrobox application with the trizen -S command.

trizen -S distrobox

After setting up the Distrobox application on your Arch Linux system, you must install and enable Docker. Follow the Docker installation instructions from the Arch Linux Wiki for help getting it set up.

How to use Distrobox on Linux

To use Distrobox, start by launching a terminal window on the Linux desktop. You can open up a terminal window on the Linux desktop by pressing Ctrl + Alt + T on the keyboard.

With the terminal window open and ready to use, run the distrobox-create command. This command will create your new container. The distrobox-create command is an easy way of typing in “docker pull x-image.”

sudo distrobox-create --name container-name --image os-image:version

Edit the command above and change the –name section to the container’s name you wish to create. In this example, we’ll create a Void Linux container.

sudo distrobox-create --name void-linux

Next, find the –image section and change image:version with one of the container distro image names from this list. In this example, we’ll use: ghcr.io/void-linux/void-linux:latest-full-x86_64.

sudo distrobox-create --name void-linux --image:ghcr.io/void-linux/void-linux:latest-full-x86_64 

Distrobox will take time to download the image and create it. So, sit back, be patient, and allow the creation process to happen. When Distrobox is finished generating your container, use the distrobox-enter command below.

sudo distrobox-enter --name void-linux

Listing containers

Do you need to list installed Distrobox containers on your computer? Run the distrobox-list command. This command will show you a list of all installed (both active and inactive) containers.

sudo distrobox-list

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.