I wrote supernested a few years ago to see if I could break nested KVM. It works by repeatedly nesting KVM guests until either something breaks or the whole thing grinds to a halt. Even on my very fastest machine I can only get to an L4 guest (L0 = host, L1 = normal guest).
Kashyap and Thomas Huth resurrected the QEMU Advent Calendar this year, and today (day 13) supernested is featured.
Please note that supernested should only be run on idle machines which aren’t doing anything else, and it can crash the machine.
CentOS 7.3 was announced today, and the x86_64 version is available in virt-builder already:
$ virt-builder centos-7.3
$ virt-builder -l | grep fedora-25
fedora-25 x86_64 Fedora® 25 Server
fedora-25 i686 Fedora® 25 Server (i686)
fedora-25 aarch64 Fedora® 25 Server (aarch64)
fedora-25 armv7l Fedora® 25 Server (armv7l)
fedora-25 ppc64 Fedora® 25 Server (ppc64)
fedora-25 ppc64le Fedora® 25 Server (ppc64le)
$ virt-builder fedora-25
$ qemu-system-x86_64 -machine accel=kvm:tcg \
-cpu host -m 2048 \
Or to try out Fedora on a different architecture:
$ virt-builder fedora-25 --arch ppc64le -o fedora-25-ppc64le.img
$ qemu-system-ppc64 -cpu POWER8 -m 2048 \
$ file builder/virt-builder
builder/virt-builder: ELF 64-bit LSB executable, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, for
GNU/Linux 2.6.32, BuildID[sha1]=184c9522f22abc5c325ac5a1ee2d272b225d5503, not stripped
Probably the least useful copy of virt-builder since there’s no qemu and no network. However it does demonstrate that we can now build large mixed C / OCaml binaries on RISC-V successfully.
$ ./run ./utils/boot-benchmark/boot-benchmark
Warming up the libguestfs cache ...
Running the tests ...
test version: libguestfs 1.33.28
test passes: 10
host version: Linux moo.home.annexia.org 4.4.4-301.fc23.x86_64 #1 SMP Fri Mar 4 17:42:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
host CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
backend: direct [to change set $LIBGUESTFS_BACKEND]
qemu: /home/rjones/d/qemu/x86_64-softmmu/qemu-system-x86_64 [to change set $LIBGUESTFS_HV]
qemu version: QEMU emulator version 2.5.94, Copyright (c) 2003-2008 Fabrice Bellard
smp: 1 [to change use --smp option]
memsize: 500 [to change use --memsize option]
append: [to change use --append option]
Result: 575.9ms ±5.3ms
There are various tricks here:
- I’m using the (still!) not upstream qemu DMA patches.
- I’ve compiled my own very minimal guest Linux kernel.
- I’m using my nearly upstream
"crypto: Add a flag allowing the self-tests to be disabled at runtime." patch.
- I’ve got two sets of non-upstream libguestfs patches 1, 2
- I am not using libvirt, but if you do want to use libvirt, make sure you use the very latest version since it contains an important performance patch.
$ time LIBGUESTFS_BACKEND=direct LIBGUESTFS_HV=~/d/qemu/x86_64-softmmu/qemu-system-x86_64 guestfish -a /dev/null run
However I had to patch qemu to enable DMA loading of the kernel and initrd.