Quickemu (the quick VM solution)

I used to use VirtualBox to run VMs on my development workstations. I’ve heard that more people are using QEMU to do similar things, but never had the time to figure out how to set it up. Now there is a tool that does it all for you:

I tried it a week back and there was a bug that would not let you install Windows without a SAP user account. With version 3.11, that bug is now fixed. On Arch Linux, its as easy to install as yay quickemu. Then you can do things like:

quickget windows 11

quickemu -vm windows-11.conf

I had recently purchased a Velocio PLC to evaluate, so needed a Windows VM to run their software. My VirtualBox installation has become very slow on my other workstation since I upgraded to 3, 4K monitors (not sure if it is related to the monitor resolution), so I needed a new solution anyway. Both Windows 10 and 11 VMs run the Velocio software fairly well.

To program a Velocio device, you need to map a USB device through to Windows. This is easy to do by displaying the spice settings:

quickemu -vm windows-11.conf -display spice

Then you can map individual devices using the Input->Select USB devices for redirection menu option.

image

There is also a Auto redirect newly plugged in USB devices option in the Options menu, which is very handy.

There are quite a few operating systems supported by quickemu:

[cbrake@ceres quickemu]$ quickget ERROR! You must specify an operating system: alma android archlinux debian elementary freebsd fedora garuda kali kdeneon kubuntu linuxmint-cinnamon linuxmint-mate linuxmint-xfce nixos-gnome nixos-plasma5 nixos-minimal lubuntu macos openbsd opensuse oraclelinux popos regolith rockylinux solus ubuntu ubuntu-budgie ubuntu-kylin ubuntu-mate ubuntu-studio windows xubuntu zorin

There are even MacOS configurations – will leave that as an exercise for the reader …

It appears that quickemu allocates a 1.5TB image, but this is a sparse file that only takes up 14MB on disk:

Deleting files may not free up space automatically in the qcow2 image, but there appear to be options for this:

Recently used quickemu to test a SIOT reported problem:

Tried to run Ubuntu and got:

[cbrake@ceres quickemu]$ quickemu -vm ubuntu-22.04.conf 
Quickemu 3.15 using /usr/bin/qemu-system-x86_64 v7.0.0
 - Host:     Arch Linux running Linux 5.18 (ceres)
 - CPU:      AMD Ryzen 9 3900X 12-Core Processor
 - CPU VM:   1 Socket(s), 4 Core(s), 2 Thread(s), 16G RAM
 - BOOT:     EFI (Linux), OVMF (/usr/share/OVMF/x64/OVMF_CODE.fd), SecureBoot (off).
 - Disk:     ubuntu-22.04/disk.qcow2 (16G)
             Looks unused, booting from ubuntu-22.04/ubuntu-22.04-desktop-amd64.iso
 - Boot ISO: ubuntu-22.04/ubuntu-22.04-desktop-amd64.iso
 - Display:  SDL, virtio-vga, GL (on), VirGL (on)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "ubuntu-22.04" --port 5930 --spice-shared-dir /home/cbrake/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-cbrake ~/Public
 - smbd:     On guest: smb://10.0.2.4/qemu
qemu-system-x86_64: Display spice is incompatible with the GL context
 - Process:  Starting ubuntu-22.04.conf as ubuntu-22.04 (1506437)

Looking through my notes above, I tried the following:

quickemu -vm ubuntu-22.04.conf --display spice

And it worked – not sure why, but I got done what I needed to do quickly – thanks to my notes above. This is the power of good notes – you figure things out once and then re-use that knowledge.

My son needed a windows machine to run MS Access for a school class, so we looked into giving him remote desktop access to a VM running on my workstation (he has a M1 MAC (ARM CPU), so running a windows VM on that gets complicated). Quickemu supports port forwarding, so this is all that is required in the conf file:

port_forwards=("3389:3389")

Then a remote desktop client can connect to the host machine.

Needed to evaluate Silicon Labs Simplicity Studio tools – they don’t run very cleanly on Arch Linux, so set up a Win11 VM on new MSI laptop that is running arch. Had to work through a few quirks and ended up adding the following:

[cbrake@quark quickemu]$ cat /etc/modprobe.d/kvm-quickemu.conf 
options kvm ignore_msrs=Y

After that, everything worked as expected:

Tested mapping an Arduino USB device, and that worked.