Imagine this: You're using one Linux distribution and you want to quickly deploy a virtual machine of another Linux distribution for either testing purposes or to have a secondary operating system to use for such things as development, training, or just to have a bit of fun trying out different distributions.
One way of going about this that is considerably easier than other options is via Boxes, which is a part of the GNOME desktop ecosystem and can be used to spin up Virtual Machines (VMs). You can create as many VMs as you like (so long as your local storage has enough space).
These virtual machines behave as guest operating systems on your host, so you can use them to get online, install applications, and do just about anything you do with your host OS. The good thing about these virtual machines is that they can be created and destroyed with ease, so if something goes wrong, you can delete the VM you're working on and start another. Say, for example, you want to install an application but you're not 100% certain how the application will interact with your host operating system (or if it's safe enough to install on the host, where your personal data resides); spin up a VM, test the application, and destroy the VM with zero harm to your default operating system.
Let me show you how to do just that. We'll spin up an instance of Endless OS as a guest on Pop!_OS running as the host.
Before we get into this, you have to first make sure your hardware is capable of virtualization. To do that, log into your Linux desktop, open a terminal window, and issue the command:
In the output of that command, you should see something like this:
Should that line appear, you're good to go.
Boxes might not be installed by default, so you might have to first install it. You can do this one of two ways. The simplest way to install Boxes is to open the Software Center (such as GNOME Software on GNOME or Discover on KDE) and search for Boxes. Once you've located the entry, click it and then click Install (Figure 1).
If you'd rather take the command-line approach, open a terminal window and issue one of the following commands.
For Ubuntu-based distributions:
sudo apt-get install gnome-boxes -y
For Red Hat-based distributions:
sudo dnf install gnome-boxes -y
Once the software is installed, you're ready to spin up your first virtual machine.
Creating a virtual machine with Boxes
Open Boxes from your desktop menu. In the resulting window (Figure 2), click + in the upper left corner.
In the resulting pop-up (Figure 3), scroll down and locate the Linux operating system you want to use for the VM.
In my case, I'll use Endless OS Basic x86_64 (Live). Make the selection and Boxes will automatically create the virtual machine (this can take some time, depending on the speed of your internet connection). When the download of the necessary ISO is finished (which Boxes does automatically), configure both the Memory and Storage limit options to suit your needs and click Create (Figure 4) to finish up.
Boxes will automatically boot the new guest operating system, where you can then walk through the installation process (Figure 5).
How the installation process goes will depend on which Linux operating system you've chosen for the guest. Once the installation is complete, you'll need to reboot and then you can log into your guest.
When you're done using the virtual machine, you can click on the left-pointing arrow (Figure 6) to pause the guest and then close out Boxes.
You can then click on the launcher for your VM to start it up at any time.
And that's how easy it is to spin up a Linux virtual machine with Boxes. If you ever require this, and your host operating system is Linux, Boxes is a great option that requires far less setup and management than some of the competition (such as VirtualBox).
Give Boxes a try and see if it doesn't become your VM solution of choice on Linux.