Pack an image using a virtual machine

Hello,

I’m repacking rocky 9 image for MAAS. It works perfectly when I use my own computer. On the server and in a virtual machine it fails due to the following setting -cpu host is unsupported
https://github.com/canonical/packer-maas/blob/main/rocky9/rocky9.pkr.hcl#L43

I wonder if one can run the build without this option. Simply removing this option causes kernel panic.

Hi @dataved ,

do you have kvm enabled?

It seems kvm is enabled:

$ sudo kvm-ok
[sudo] password for afedotov:
INFO: /dev/kvm exists
KVM acceleration can be used

Here is the error message:

qemu-system-x86_64: CPU model 'host' requires KVM or HVF

I don’t know by heart (if anybody knows, please jump in!).

Since you have a working machine, I’d first check and compare all the packages and their versions - qemu, packer and the others installed

thanks for your suggestion!

adding a user to kvm group helped on a server without VM, probably the script was modified to run as unprivileged

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.