astro / microvm.nix

NixOS MicroVMs
https://astro.github.io/microvm.nix/
MIT License
1.38k stars 101 forks source link

qemu crashes when running a microvm #212

Closed 999eagle closed 8 months ago

999eagle commented 8 months ago

Every microvm instantly crashes with the following output from qemu:

/build/qemu-8.2.1/include/hw/i386/pc.h:144:PC_MACHINE: Object 0x5f9b9c9eb010 is not an instance of type generic-pc-machine
[1]    40361 IOT instruction (core dumped)

This is an upstream issue of qemu itself (see https://gitlab.com/qemu-project/qemu/-/issues/2142) when running qemu-system-x86_64 -M microvm,accel=kvm -cpu host, which microvm.nix uses on x86_64-linux. It can be reproduced both with the completely unchanged flake template from this repo and when using qemu from nixpkgs directly. I'm currently working around this by patching the microvm-run script to use pc as the machine type instead of microvm which I'm fine with, but this could be a problem for others.

astro commented 8 months ago

Unfortunately, none of my current computers have SGX.

As long as this is a problem with latest qemu version I'm going to take any PRs that work around this issue.