Wednesday, July 28, 2021
Latest News from Cambridge and England


Virtualization on the Linux desktop—Gnome Boxes vs virt-manager

Yes, you can just install Gnome Boxes from Software Center—but I'm a sysadmin at heart; I used ..

By admin , in Tech , at April 30, 2020

  • Yes, you can just install Gnome Boxes from Software Center—but I'm a sysadmin at heart; I used apt instead. Jim Salter
  • I really like the Welcome Tutorial that Boxes gives you. It's short, to the point, and exposes features you'd likely miss otherwise. Jim Salter
  • The easy downloads is a pretty nifty feature—you don't need to hunt down install ISOs; Boxes already knows where they are and will fetch them for you. Jim Salter
  • The drag-and-drop functionality works as advertised—with a Linux guest and a Gnome3 desktop, anyway. Jim Salter

In the comments of our recent GhostBSD review, reader Enduzzer casually mentioned trying out the distribution in a Gnome Boxes VM. Linux's Kernel Virtual Machine has been a mainstay of my own system administration for more than a decade—but I use virt-manager, an excellent and deeply sysadmin-ish graphical management interface.

I generally describe virt-manager as "simple"—and in many ways it's much simpler than Boxes is—but there are different ways to interpret simplicity.

The integrated approach

  • We had good results with an Ubuntu Focal Fossa guest, running on our Ubuntu Focal Fossa host system. Jim Salter
  • Dragging a screenshot from Files on the host operating system (right monitor) onto the Boxes guest (left monitor) immediately produces a "ready to receive files" notification dialog. Jim Salter
  • Ta-da! The screenshots we dragged and dropped from the host into the Boxes guest were copied, and show up in Downloads for the guest's logged-in user. (It doesn't work in the other direction—you can't drag from guest to host.) Jim Salter
  • When we resize the Boxes window, the Ubuntu Focal guest within it automatically changes its own video resolution to fit. Jim Salter

Under the hood, Boxes shares the majority of its technical underpinnings with virt-manager: the libvirt virtualization API, the Linux Kernel Virtual Machine (KVM) hypervisor, and the qemu generic processor emulator. Virt-manager exposes those inner workings as much as possible while trying not to get them unnecessarily in the way.

Boxes approaches the same problem from the opposite direction—it abstracts away as much as possible, with no apologies for doing so.

Boxes […] is targeted towards a typical desktop end-user who wants either a very safe and easy way to try out new operating systems or new (potentially unstable) versions of her/his favorite operating system(s), or needs to connect to a remote machine (home-office connection being a typical use-case). For this reason, Boxes does not provide many of the advanced options to tweak virtual machines provided by virt-manager. Instead, Boxes focuses on getting things working out of the box with very little input from user.

This desktop-focused approach may begin with trimming away advanced options, but it doesn't end there—Boxes offers quite a few usability tweaks that virt-manager doesn't, and likely won't. This effort at greater integration begins before a new virtual machine is even running. Most popular—and even not-so-popular—guest operating systems are available in Boxes as a built-in download direct from the source. Instead of needing to google "OpenBSD" to find a download link, a Boxes user can just start typing "open" into a search field and immediately see a list of OpenSUSE and OpenBSD versions.

The extra integration is most evident when running Linux guests (virtual machines), where virtio drivers are always available and libvirt integration is at a maximum. When we tested an Ubuntu Focal Fossa guest, the guest's video resolution changed dynamically and automatically as we resized its window on the host operating system—and files dragged from the host's file explorer onto the Boxes window were automatically transferred into the guest, where they showed up in the logged-in user's Downloads folder.

Easy mode isn't necessarily easier

  • Clicking the plus sign begins the fun—time to install a new VM in Boxes. Jim Salter
  • I have to admit, the searchable distribution screen was cool. As I typed "open," the list automatically populated with matching known distros. Jim Salter
  • After Boxes downloaded OpenBSD 6.6, it popped up this review dialog with resource allocation defaults. Jim Salter
  • Clicking "Customize" doesn't offer you much—RAM and virtual disk size only. You can't control vCPUs here, or where the VM's storage is here, its network stack, or anything else. Jim Salter
  • After clicking "Create" we're off to the races. Behold—an OpenBSD installation! Jim Salter
  • We immediately hit problems in our OpenBSD VM, still in the installer. For example, there's awful keybounce—a problem I haven't seen since TRS-80s! Jim Salter
  • The OpenBSD install wouldn't complete at all under Boxes—but under virt-manager, as seen here, it "just worked" without so much as a hiccup. Jim Salter

Although I led with a good experience above, the Ubuntu Focal guest wasn't actually the first thing I tried. Boxes specifically aims to give inexperienced users "a very safe and easy way to try out new operating systems"—so that's just what I did, shooting for the moon with an OpenBSD install attempt on my first try.

Searching for OpenBSD under the Create VM dialog went extremely well—as I typed "open" into the search box, it dynamically populated the list of known distros with matching results. I skipped down past OpenSUSE and went directly to OpenBSD, which I'd never run before. This seemed to go well at first—it downloaded the ISO quickly, and jumped right into an installation—but the installation itself had severe problems, and I never got a working guest out of it.

OpenBSD's installer is quite primitive and couldn't cope with some of the choices Boxes had made for its environment. It couldn't successfully find its own files on the virtual CD it had booted from, it didn't quite understand the network stack (interpreting its IP address as static rather than DHCP), and it had incredibly bad keybounce. (If you had to click that link to figure out what keybounce is, I don't blame you.)

By contrast, OpenBSD installed without a hitch under virt-manager. Although I did need to download an OpenBSD 6.6 ISO manually and point virt-manager to it—and select the number of vCPUs as well as how much RAM and disk space to allocate—the actual install there went flawlessly. In less than five minutes total, virt-manager delivered a working OpenBSD guest without so much as a hiccup.

Brittle installation environment aside, Boxes will probably frustrate fellow KVM veterans immensely. Guests running under Boxes can't be managed or inspected with the usual libvirt-related commands—you won't see a running Boxes guest under virt-top, virsh list, or similar tools.

The papercuts continue

  • I appreciate how easy it is to pass USB devices down into a Boxes guest. Jim Salter
  • Opening a Boxes guest's Properties window puts you in a dangerous place—your mousewheel scrolls the dialog, until that places the cursor over the Memory or Disk Size sliders… at which point it's suddenly moving that slider. Yikes! Jim Salter
  • Boxes also offers snapshot creation—in theory, at least. When I tried to create a snapshot of my Ubuntu guest, Boxes just said it failed—with no indication of why. Jim Salter

OpenBSD problems aside, Boxes was pretty painful even with better-supported guests. It automatically hibernated my Ubuntu Focal Fossa VM when I closed the main Boxes window—and when I tried to open Boxes again, the entire application timed out waiting for the Fossa guest to reboot. I had to click Boxes from the launcher a second time, several seconds later, before anything visible happRead More – Source

Comments