This guide will show you how you can run multiple distributions of Linux on a single terminal in Ubuntu.
Follow along with this step-by-step guide on how you can easily run multiple OS on a single terminal so that you don’t have to deal with the hassle of installing multiple virtual machines on a single PC.
Linux is an open-source operating system famous for its high speed and security. It is used by many developers and is used as the main Operating System in many high-end companies around the world.
Ways of Running Multiple Linux Distributions
One way to run all these Linux distributions is to run multiple instances of Virtual Machines on a single Computer, which is extremely energy-demanding, and a normal Computer won’t handle this much load.
The other way is to run these on a single OS, and we will cover the way to do that.
Distrobox is an open-source repository on GitHub that uses Podman and docker to create containers that play an essential role when running multiple distributions of Linux on a single OS.
The list of all the Operating systems that are compatible to run Distrobox can be found here.
To install and run Distrobox, we need to install Podman.
Open your terminal in Ubuntu and use the command:
sudo apt install podman
Now that the Podman is installed, we will start installing Distrobox.
To install Distrobox, we need to type this into the terminal :
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
To check the version of Distrobox and the commands that we can use in Distrobox, type this into the terminal.
If Distrobox is successfully installed, then the terminal will show this.
Now that the Podman and Distrobox are successfully installed, we will create the container in DIstrobox and start downloading desired OS image in that container.
Installing and running Fedora Linux in Ubuntu
To download fedora, we will type the command below in the terminal.
distrobox-create -n fedora --image fedora:latest
Here fedora is the name of the container that you are saving locally and :latest is the version that you are downloading. We can use the version name instead of :latest as well.
After confirming, you will be able to pull the image of the OS on your computer, and it will install itself.
To check the installed OS images on your computer, type the command below, which will show you the list.
If fedora is successfully installed and you have typed the above command, then the terminal will show you this result.
To run the image of Fedora that we downloaded, we will have to type this command in the terminal.
fedora is the name of the container that we saved locally in our Ubuntu.
After running this command, all the essential packages will start to install.
The terminal will then switch to the fedora. To check the information of running OS, type this command in the terminal.
The OS that your terminal is running in would be fedora.
Now we will be able to install the tools and scripts in fedora. To do this, we will use this command to install dependencies in fedora.
sudo yum install neofetch
After installation, we can write a command to check the installation.
Installing and running Kali Linux in Ubuntu
Now that fedora is installed, we will install another OS (Kali Linux) in Ubuntu. To do that, type this command in the terminal.
distrobox-create -n kali --image kali-rolling:latest
To check the creation of the package, we will use the same command as before.
To run the image of Kali Linux that we downloaded, we must type this command in the terminal.
The OS that your terminal is running in would be Kali Linux.
Now that Kali Linux is installed, we will download some packages for Kali Linux.
sudo apt install neofetch firefox-esr guymager
To check these packages we will type the package name into the console.
The above command will show us this result.
To check other installed packages, type this into the terminal.
Upon typing this command, the result would be this.
To check the last package that we installed, type this into the terminal.
The guymager tool will start upon entering this command.
Stopping and Removing all the running OS in Ubuntu
Now that we have installed two different OS in a single terminal, it’s time to close them, and to do that, we have to type the commands given below.
We can use the id of the containers instead of names as well.
These commands will stop the running of both OS instances on your Ubuntu.
To remove the OS from the distrobox list, we will have to use these commands.