Go beyond VirtualBox
Get your first VM running in seconds, with the simple elegance of Gnome Boxes…
Back in the mid-naughts, commodity CPUs learned a new trick. The idea had been around for a while, but the urge to make data centres ever more efficient really brought it to the fore. That idea was virtualisation, and on x86 platforms it first appeared in the form of Intel’s VT-x and AMD’s V on their early 64-bit CPUs. These instructions weren’t groundbreaking in themselves, but they did enable simple software (such as Microsoft’s Virtual PC or Sun’s – now Oracle’s – VirtualBox) to spin up virtual machines easily, thanks to being able to run a (largely unmodified) guest OS in a deprivileged environment.
It’s important to avoid confusion with emulation. Emulation is imitation, and to emulate properly everything must be imitated pretty much exactly. That means processor bugs, weird firmware logic and even the rotation of floppy disks all have to be simulated. And this is a slow process, even on a fast CPU. With virtualisation some hardware may be emulated, but the processor instructions from within the guest are run more or less verbatim on the host CPU. Anything can be emulated, but only machines of the same architecture can be virtualised. So this tutorial won’t help you create a virtual Apple M1 on your desktop box.
The Linux Kernel has its own hypervisor (a thing that runs virtual machines) called KVM. Others include VMware’s ESXi, Xen and the ubiquitous VirtualBox. VirtualBox is the de facto hypervisor for many a home user, because it’s easy to get started, it’s cross-platform and if you need something out of the ordinary there’s probably an easy option to get that working. But VirtualBox is made by Oracle, and while it’s open source (both the core and the guest additions are GPL2-licenced) that company doesn’t have a stellar reputation as stewards of FOSS.
Instead, we’d urge you to try Gnome Boxes. It’s a front-end for libvirt (a platform for managing VMs), which behind the scenes uses KVM and QEMU (an emulator that can also virtualise). Libvirt can happily talk to other hypervisors too, but let’s not get ahead of ourselves. Gnome Boxes is available as a Snap or Flatpak; however, our experience with the Snap wasn’t positive. So we’d recommend installing from your distro’s repositories. On Ubuntu you can find a Deb from the Software application. Click the drop-down labelled Source in the top-right to find it. Libvirt allows for all kinds of customisations, but Boxes is a delightfully simple application. So simple we’ve condensed set up of our first virtual box to a simple three-step dance (below).