VMs do no start until the CPU configuration is set to “Copy host CPU configuration”

OK, I think I found what is the problem :slight_smile:

First, at least one of the kernel hardening boot parameters somehow messes with the CPU detection on the host (in my case, a quadcore showing only two physical cores, the virtual cores being ignored), which heavily decreases performances. I need to further investigate this issue to find out which specific boot parameter(s) causes that.

But the main problem is that currently the VMs domain types in the host are set as qemu and not kvm. Indeed, this is done on purpose during building as a workaround to configure the VMs:

## workaround to replace the 'kvm' domain type with 'qemu' otherwise libvirtd service will fail to start in chroot
sed -i "1 s/^.*$/<domain type='qemu'>/" "$temp_dir/xml/Whonix-Gateway.xml"
sed -i "1 s/^.*$/<domain type='qemu'>/" "$temp_dir/xml/Whonix-Workstation.xml"

The problem is that this temporary change must be reverted back once the VMs have been configured, which was initially taken care of, but these lines were (probably mistakenly) removed from the same file:

## now we can replace back 'qemu' with 'kvm' domain type
sed -i "8 s/^.*$/<domain type='kvm'>/" $CHROOT_DIRECTORY/etc/libvirt/qemu/Whonix-Gateway.xml
sed -i "8 s/^.*$/<domain type='kvm'>/" $CHROOT_DIRECTORY/etc/libvirt/qemu/Whonix-Workstation.xml

See my pull request :slight_smile: (I hope I changed the right file! but you get the idea…)

1 Like