machine: enable nested virt on libkrun by default

With the recent release of krunkit 0.2.0, a CLI option was added to
enable nested virtualization on macOS hosts with an M3 or higher. Enable
this by default. If the host does not support this feature, krunkit will
ignore the argument and continue starting the VM.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
Jake Correnti
2025-04-18 13:00:13 -04:00
parent 8761b67ca5
commit 2ef0148b8a

View File

@ -225,6 +225,13 @@ func StartGenericAppleVM(mc *vmconfigs.MachineConfig, cmdBinary string, bootload
cmd.Args = append(cmd.Args, "--gui") // add command line switch to pop the gui open
}
if mc.LibKrunHypervisor != nil {
// Nested Virtualization requires an M3 chip or newer, and to be running
// macOS 15+. If those requirements are not met, then krunkit will ignore the
// argument and keep Nested Virtualization disabled.
cmd.Args = append(cmd.Args, "--nested")
}
if mc.IsFirstBoot() {
// If this is the first boot of the vm, we need to add the vsock
// device to vfkit so we can inject the ignition file