VirtualBox

How to Run Virtual Machines Using GNOME Boxes in Linux

This article will cover a guide on installing and using “GNOME Boxes” application in Linux. You can use it to create and manage local or remote virtual machines. You can run many supported operating systems in these virtual machines by saving content in virtual hard drives.

About GNOME Boxes

Developed by the GNOME team, GNOME Boxes is a part of the official GNOME software suite. It is a graphical frontend for creating and managing QEMU virtual machines. QEMU is a command line tool that can emulate hardware components and run virtual machines containing full installation of various operating systems available out there. A graphical utility called, “virt-manager” is available that can be used to manage QEMU virtual machines. However, its user interface can be a bit overwhelming with its numerous built-in configuration options. GNOME Boxes aims to simplify the interface by only exposing necessary features to end users. It is more oriented towards casual desktop users who want to manage virtual machines for day to day tasks and want to run virtual machines quickly without much hassle. Advanced users, specially those who manage QEMU virtual machines for businesses and organizations, can always use the virt-manager graphical frontend.

Other main features of GNOME Boxes include:

  • Ability to download ISO image files from the app itself.
  • You can drag and drop files to share them between the virtual machine and the host OS.
  • Ability to take snapshots of virtual machines and restore them quickly.
  • Supports Running full screen virtual machines.
  • Ability to take screenshots of running virtual machines from the host OS.
  • Supports virtual machines running non-Linux operating systems like Windows 10.
  • You can run ISO image files in bootable LIVE mode and test the OS before installing.
  • Supports 3D hardware acceleration in almost all modern Linux distributions as long as you have capable hardware.

Installing GNOME Boxes

You can install GNOME Boxes in Ubuntu by running the command specified below:

$ sudo apt install gnome-boxes

GNOME Boxes is available in all major Linux distributions, so you can install it from the package manager. Alternatively, you can grab a universal Flatpak build that works on almost all Linux distributions from here.

Creating a New Virtual Machine Using GNOME Boxes

To create a new virtual machine, launch the “Boxes” or “GNOME Boxes” app from the application launcher and click on the “+” icon located at the top left corner of the application window.

You will be presented with a configuration wizard that will guide you through creation of a virtual machine. The very first step involves selection of an ISO image file for an operating system. This operating system will be launched in a virtual machine like any other real hardware, and from there, you can proceed to install the operating system onto the virtual hard drive. GNOME Boxes provides you an option to directly download ISO image files for many popular operating systems from the app itself.

Once you have chosen your own or a downloaded ISO image file, select a template for your operating system so that GNOME Boxes can automatically configure and optimize the virtual machine for your desired operating system. For instance, if you have selected an Ubuntu ISO image, choose “Ubuntu” as template. If you are installing Fedora in the virtual machine, select “Fedora” as template. GNOME Boxes also contains a template for installation of Windows 10.

Once you have selected an appropriate template, click on the “Next” button. You will be presented with the final step in the configuration wizard. Here, you can click on the “Customize” button to get advanced settings where you can modify the memory and storage allocation for the virtual machine. Once you are done with the customizations, click on the “Create” button to finish creation of the virtual machine.

After you click on the “Create” button, the virtual machine will boot the selected ISO image. You can either continue to run the image in LIVE mode or install the full operating system within the virtual machine and the virtual hard drive.

You can click on the back arrow on the top left corner to pause the virtual machine. When you next start the virtual machine again, the operating system will resume in its previous state. This process of pausing and resuming the virtual machines happens extremely fast and just takes a few seconds. In case you want to shutdown the virtual machine and don’t want to pause it, click on the three dot menu on the header bar and then click on the “Force shutdown” option. You can also shutdown the guest operating system from within the virtual machine itself, just like you would do on real hardware.

Managing Settings of Existing Virtual Machines and Taking Snapshots

To manage an existing virtual machine in GNOME Boxes, right click on a virtual machine in the list and click on the “Properties” menu option.

From here, you can reconfigure your virtual machine and change memory and storage allocation. You can also change file sharing settings and take snapshots that will allow you to restore virtual machines to their previous states.

Backing Up Virtual Machines Created Using GNOME Boxes

GNOME Boxes creates and stores virtual images in a directory located at the following path:

$HOME/.local/share/gnome-boxes/images/

You can simply copy all image files located at the path above on an internal or external drive to take a backup of virtual machines. In case you have accidently deleted them or you are reinstalling the host operating system, just copy back all the image files to the location specified above to get back all the virtual machines.

Conclusion

GNOME Boxes provides an excellent way to run QEMU virtual machines quickly on your Linux computer. It doesn’t feature many configuration options but it provides a seamless experience where you can pause and resume virtual states quickly.

About the author

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.