/>
X

How to spin up a Linux virtual machine quickly with Boxes

Boxes is a great way to spin up virtual machines on Linux. Jack Wallen shows you how it's done.
jack-wallen-thumb4x3.jpg
Written by Jack Wallen, Contributing Writer on

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:

lscpu

In the output of that command, you should see something like this:

Virtualization: VT-x

Should that line appear, you're good to go.

Installing Boxes

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).

Figure 1

boxes1.jpg

Installing Boxes on Fedora 36.

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.

Figure 2

boxes2.jpg

I've already created two virtual machines in Boxes.

In the resulting pop-up (Figure 3), scroll down and locate the Linux operating system you want to use for the VM.

Figure 3

boxes3.jpg

Choosing an operating system for the virtual machine.

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.

Figure 4

boxes4.jpg

Finalizing the virtual machine creation with a single click.

Boxes will automatically boot the new guest operating system, where you can then walk through the installation process (Figure 5).

Figure 5

boxes5.jpg

Installing EndlessOS as a guest in Boxes.

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.

Figure 6

boxes6.jpg

EndlessOS is running as a guest virtual machine in 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.

Related

How to use the scp command in Linux
SSH, OpenSSH

How to use the scp command in Linux

Linux
How to install Linux applications from the command line
Computer user looking at laptop at home

How to install Linux applications from the command line

Linux
How to enable Linux on your Chromebook (and why you should)
The Chrome OS system tray popup menu.

How to enable Linux on your Chromebook (and why you should)

Linux