From 94ab68a587b890b3051ae27768b7d40ae2aa2b62 Mon Sep 17 00:00:00 2001 From: Abiola Ibrahim Date: Sat, 9 Nov 2024 14:58:25 +0100 Subject: [PATCH] incus: always enable nested virtualization when supported. Signed-off-by: Abiola Ibrahim --- cmd/start.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/start.go b/cmd/start.go index 5fae7857..600ae7b7 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -18,6 +18,7 @@ import ( "github.com/abiosoft/colima/embedded" "github.com/abiosoft/colima/environment" "github.com/abiosoft/colima/environment/container/docker" + "github.com/abiosoft/colima/environment/container/incus" "github.com/abiosoft/colima/environment/container/kubernetes" "github.com/abiosoft/colima/util" "github.com/abiosoft/colima/util/osutil" @@ -286,6 +287,15 @@ func setFlagDefaults(cmd *cobra.Command) { } } } + + // always enable nested virtualization for incus, if supported and not explicitly disabled. + if util.MacOSNestedVirtualizationSupported() { + if !cmd.Flag("nested-virtualization").Changed { + if startCmdArgs.Runtime == incus.Name && startCmdArgs.VMType == "vz" { + startCmdArgs.NestedVirtualization = true + } + } + } } func setConfigDefaults(conf *config.Config) {