Linux Format

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 virtualisa­tion, 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 instructio­ns weren’t groundbrea­king 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 deprivileg­ed environmen­t.

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 virtualisa­tion some hardware may be emulated, but the processor instructio­ns from within the guest are run more or less verbatim on the host CPU. Anything can be emulated, but only machines of the same architectu­re can be virtualise­d. 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 hypervisor­s 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 repositori­es. On Ubuntu you can find a Deb from the Software applicatio­n. Click the drop-down labelled Source in the top-right to find it. Libvirt allows for all kinds of customisat­ions, but Boxes is a delightful­ly simple applicatio­n. So simple we’ve condensed set up of our first virtual box to a simple three-step dance (below).

 ?? ?? We’ll see later how you can get 3D accelerati­on working in your VMs, like the Vulkan cube demo.
We’ll see later how you can get 3D accelerati­on working in your VMs, like the Vulkan cube demo.

Newspapers in English

Newspapers from Australia