Skip to content

Commit

Permalink
incus: always enable nested virtualization when supported.
Browse files Browse the repository at this point in the history
Signed-off-by: Abiola Ibrahim <[email protected]>
  • Loading branch information
abiosoft committed Nov 9, 2024
1 parent ae4a537 commit 94ab68a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 94ab68a

Please sign in to comment.