-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple Silicon M3 + MacOS 15: nested virtualization more easier #2824
Comments
Did you mean inactive? I tried it on MacBook Pro 2020 (2.3 GHz Quad-Core Intel Core i7) with macOS 15.1, but it didn't work: |
No you misunterstanded me. I don't say that VZ by default enabled nested virtualization, i just said that by default on any intel plateform (linux, windows...) it's is enabled by default with other virtualization engine like qemu and Hyper-V and other... with native host feature... I think somewhere in the code you must have this: swift code
|
I think the code you are looking for is Lines 240 to 258 in 021c974
What do you suggest needs changing? I don't understand your feedback. |
Hello, I suggest that: // nested virt
if macOSProductVersion, err := osutil.ProductVersion(); err == nil {
if macOSProductVersion.Compare(*semver.New("15.0.0")) >= 0 && vz.IsNestedVirtualizationSupported() {
if driver.Instance.Config.NestedVirtualization == nil {
driver.Instance.Config.NestedVirtualization = ptr.Of(true)
}
if *driver.Instance.Config.NestedVirtualization {
if err := platformConfig.SetNestedVirtualizationEnabled(true); err != nil {
return fmt.Errorf("cannot enable nested virtualization: %w", err)
}
}
}
} else {
return fmt.Errorf("failed to get macOS product version: %w", err)
} and remove in default.go
In this case, the nested feature is always enabled by default except if we decide to disabled it. By the way we don't need to pass a yml config or modify existing config. Your actual implementation mean that the user must check before running limactl if nested is supported else he got an error... |
@Fred78290 Problem in enabling by default is, it may have performance impact. For Instance, when we enable rosetta for vz there will be a performance impact which is expected. Similarly there may be some here as well. If you want a one-liner to enable via command line argument, this should work
|
The problem is if I use this on MAc with unsupported nested virtualization, I got an error :( Except Rosetta2 emulation, I'm not sure of performance impact. So if rosetta is enabled, by default nested could be disabled. Well running VM X86 on MacOS silicon, I think that the user has already accepted degraded performance. And typically it's for developement environment. Isn't it? |
Can you share the error ?? After error is VM getting created or failed ?
My point is, similar to rosetta we might have performance impact here as well. Not mixing rosetta with nested Virtualization |
Just by reading the code :)
|
I think the best way to deal with this would be to create nestedVirtualization: true That way any machines created on that host will have nested virtualization enabled by default, unless you override it in the |
And half of the point of using containers is to avoid things like nested virtualization, so it seems OK to have it opt-in. |
That's not really the use case of the Rosetta, it's more like running a few legacy binaries that haven't been rebuilt Similar to how we used to have multilib support, to be able to run some old i386 binaries that weren't amd64 yet? You can still emulate the entire system if you want to, like with RISC-V, and then you accept like 10x slower... |
Description
After installing the version 10.0.0-beta to test nested virtualization on M3; the default template doesn't offer nested virtualization on MacOS 15 + M3 or higher CPU.
After reading concerned code (fork of Code-VZ) the ability of nested virtualization must be true by default if required conditions are present.
On intel plateform the nested virtualization is always active.
Else add a command line option.
Regards
The text was updated successfully, but these errors were encountered: