You are currently viewing the United Kingdom version of the site.
Would you like to switch to your local site?
25 MIN READ TIME

Fast Virtual Machines

Jonni Bidwell transcends meat space, ventures virtuously into the valleys of the virtual and returns laden with actual knowledge.

Virtualisation… where would we be without it? We don’t actually know, but life would certainly be harder. Thanks to virtual machines (VMs), home users can effortlessly boot all manner of other operating systems. Those might be exotic flavours of Linux or (since you surely don’t really need an actual install of this monstrosity anymore) a Windows VM for those odd times where it’s handy. This can be taken to extremes, too. Thanks to PCIe passthrough, which we covered back in LXF273, you can sacrifice a whole GPU to your VM, enabling it to run games (or CUDA simulations) arbitrarily close to native speed.

This time around we’ll look at a different but equally impressive technology in the form of Intel GVT-g. This makes it possible for us to segment newer Intel GPUs into virtual ones that can be seamlessly connected to our VMs. Unlike the passthrough method, this still enables us to use the GPU on the host.

Businesses, too, have a lot of love for the virtuals. VMs are highly portable and much easier to reinstantiate than regular machines in the event that the host running them catches fire. There’s also an efficiency improvement, in that a single machine can take on the role of several servers, and still enjoy the benefits of having those workloads properly segregated. Containers, of course, achieve this with even more efficiency, but at the cost of losing some of that segregation.

There are all kinds of tools for managing virtual machines at scale, so we’ll have a brief look at one of those, too. Specifically, we’ll show you that Vagrant makes it trivially easy to install Arch Linux.

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

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

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for 99p
SUBSCRIBE NOW
30 day trial, then just £9.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
August 2022
VIEW IN STORE

Other Articles in this Issue


WELCOME
First step…
It seems that Tux can safely visit Hell,
REGULARS AT A GLANCE
Ubuntu Snaps under fire
The release of Ubuntu 22.04 has prompted more people to complain about the usefulness of Snaps.
Framework Laptop receives 12th gen processor upgrade
Popular modular laptops with Linux support now available with 12th gen Intel processors.
Turkish district reaps Linux rewards
Local government saves $1m by going open source.
DECISIONS, DECISIONS
Matt Yonkovit is the head of open source
BE A GIT
Keith Edmunds is MD of Tiger Computing Ltd,
Convergence lives on with Gnome Shell
The dream of a Linux desktop for mobile devices isn’t dead in the water.
Mesa 22.1 brings better ray tracing
Open-source graphics driver stack receives a big update.
Thunderbird donations increase
Revenue of the email client rose by 21 per cent in 2021.
Distro watch
What’s down the side of the free software sofa?
SPOTLIGHT ON MESON
Xavier Claessens is a senior software engineer at
MULTIMESS
Jon Masters is a kernel hacker who’s been
Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to.
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Mailserver
WRITE TO US Do you have a burning
Kooha
Version: 2.0.1 Web: https://github.com/seadve/kooha
AppImage Pool
Version: 5.0.0 Web: https://github.com/prateekmedia/appimagepool
Blanket
Version: 0.6.0 Web: https://github .com/rafaelmardojai/blanket
Universal Media Server
Version: 10.21.0.1 Web: www.universalmediaserver.com
Beaker Browser
Version: 1.1.0 Web: https://beakerbrowser.com
superProductivity
Version: 7.11.5 Web: https://super-productivity.com
Safe Eyes
Version: 2.1.3 Web: https://slgobinath . github.io/SafeEyes
Mudlet
Version: 4.16.0 Web: www.mudlet.org
StackAndConquer
Version: 0.10.0 Web: https://github.com/ElTh0r0/stackandconquer
Bottles
Version: 2022.5.14-trento-3 Web: https://usebottles.com
Filmulator
Version: 0.11.1 Web: https://filmulator.org
REVIEWS
GoDaddy
Purchase and bid on domains with the daddy of services and Stefan Ionescu.
OpenSUSE 15.4
If someone were to compile the definitive list of the mysteries of life, Mayank Sharma would ask them to include openSUSE at number 42.
Tails 5.1
This distro is one of those things that Mayank Sharma would rather have and not need, than need and not have.
OpenMediaVault 6
Old wine in a new bottle is such a cliché, but that’s exactly how Mayank Sharma likes his software to grow and evolve.
OnlyOffice 7.1
Usually Mayank Sharma will run everything that’ll fit inside a browser, but today he’ll try something he’s petrified to launch even as a native program.
The Stanley Parable: Ultra Deluxe
Management doesn’t like self-referential things. It just reminds them they’re a simple strapline-based comedy construct of Christopher Livingston.
ROUNDUP
Raspberry Pi distros
The top-end Raspberry Pis can be used to build a formidable desktop. Michael Reed finds there’s a fair bit of choice when it comes to Linux distros
Pi USER
Turing 2 Pi raises $1 million in a day
The Pi-based cluster computing Kickstarter project smashes its own targets for full funding.
Waveshare CM4-NANO
Les Pounder looks at Waveshare’s Compute Module 4 carrier board that offers Raspberry Pi 4 performance in a near Zero-sized package.
Create a custom LCD menu system
Les Pounder loves to get hands-on with a good button, and if doing so can save him time and looks great, then it’s a win-win situation!
Replacing rc.local and using Systemd
Sean Conway is struggling with change – specifically, what system administration knowledge to keep and what to throw away.
IN DEPTH
World Web 3
Battle lines are being drawn up as technologies for a Web 3.0 are primed and loaded, Mats Tage Axelsson helps you prepare for a user-owned world.
IN DEPTHTUTORIALS
Multi-boot USB drives
Shashank Sharma can’t parallel park, but he knows how to just copy and paste live distributions into a USB drive to boot ‘em up.
TUTORIALS
How to take better screengrabs in Ubuntu
Nick Peers reveals how easy it is to take screengrabs and annotate them using a combination of Ubuntu’s built-in tools and third-party utilities.
Emulate the first portable computer
Rounding off our emulation series, Mike Bedfords revives the first portable computer that ran the bizarre APL language.
Make beautiful algorithmic music
Create royalty-free music automatically, or try your hand at producing music by coding. Mike Bedford explores both composition options…
Back up and copy entire hard drives
Michael Reed shows you how to tame Clonezilla, a powerful piece of software that can help copy and restore hard disk partitions.
Keep your passwords secret and safe
David Rutland has learned from past mistakes, and endeavours to keep all of his logins, usernames and passwords firmly under lock and key.
Configure a crossplatform KVM system
Use Barrier to replace a physical KVM switch and enable a keyboard and mouse to be shared between multiple devices. Matt Holder explains all.
SEEING THE LIGHT
Three humble developers of Bodhi Linux enlighten Jonni Bidwell on the ways of Zen and the art of distro maintenance.
CODING ACADEMY
Controlling processes and using Unix signals
Join Mihalis Tsoukalos as he demonstrates how to use Rust to work and manage child processes, and handle Unix signals.
Updating the LXF GIT monitoring tool
John Schwartzman adds new features to an existing PyQt5 program that finds all of your git repositories and displays their status.
Chat
X
Pocketmags Support