{"record":{"id":"306850527d6cee52","repo":"lima-vm/lima","slug":"nested-virtualization-requires-macos-15-or-newer-306850","errorCode":null,"errorMessage":"nested virtualization requires macOS 15 or newer","messagePattern":"nested virtualization requires macOS 15 or newer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vm_darwin.go","lineNumber":355,"sourceCode":"\t}\n\treturn platformConfig, nil\n}\n\nfunc attachPlatformConfig(inst *limatype.Instance, vmConfig *vz.VirtualMachineConfiguration) error {\n\tplatformConfig, err := newPlatformConfiguration(inst)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// nested virt\n\tif *inst.Config.NestedVirtualization {\n\t\tmacOSProductVersion, err := osutil.ProductVersion()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to get macOS product version: %w\", err)\n\t\t}\n\n\t\tif macOSProductVersion.LessThan(*semver.New(\"15.0.0\")) {\n\t\t\treturn errors.New(\"nested virtualization requires macOS 15 or newer\")\n\t\t}\n\n\t\tif !vz.IsNestedVirtualizationSupported() {\n\t\t\treturn errors.New(\"nested virtualization is not supported on this device\")\n\t\t}\n\n\t\tgenericPlatformConfig, ok := platformConfig.(*vz.GenericPlatformConfiguration)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"nested virtualization is not supported on %T\", platformConfig)\n\t\t}\n\n\t\tif err := genericPlatformConfig.SetNestedVirtualizationEnabled(true); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot enable nested virtualization: %w\", err)\n\t\t}\n\t}\n\n\tvmConfig.SetPlatformVirtualMachineConfiguration(platformConfig)\n\treturn nil","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vm_darwin.go#L337-L373","documentation":"Nested virtualization via VZ (VZGenericPlatformConfiguration.SetNestedVirtualizationEnabled) requires macOS 15 (Sequoia) or newer. attachPlatformConfig checks osutil.ProductVersion() and refuses with this hard error when the host is older than 15.0.0 while nestedVirtualization is enabled in the instance config.","triggerScenarios":"Starting a VZ instance with nestedVirtualization: true on macOS 14.x or older.","commonSituations":"Copying a template that enables nested virtualization (e.g. for Docker-in-Docker or VM-in-VM) onto an older macOS host; forgetting the OS requirement after migrating the instance.","solutions":["Upgrade the host to macOS 15 (Sequoia) or newer.","Set nestedVirtualization: false in the instance's lima.yaml.","Remove nested virtualization requirements from the workload, or use a Linux host with KVM nested virt via QEMU driver instead.","Check the macOS version with `sw_vers -productVersion` before enabling the option."],"exampleFix":"// before (lima.yaml)\nnestedVirtualization: true\n// after (lima.yaml)\nnestedVirtualization: false  # requires macOS 15+ to enable","handlingStrategy":"validation","validationCode":"// preflight: only enable nested virt on macOS 15+\nver=$(sw_vers -productVersion)\n[ \"$(echo \"$ver\" | cut -d. -f1)\" -ge 15 ] || echo \"nestedVirtualization requires macOS 15+ (have $ver)\"","typeGuard":null,"tryCatchPattern":"// Go: gate the config field on OS version\nif macVer.LessThan(*semver.New(\"15.0.0\")) {\n    return errors.New(\"nested virtualization requires macOS 15 or newer\")\n}","preventionTips":["Check macOS version before setting nestedVirtualization: true","Document the macOS 15+ requirement in instance templates","Fall back to non-nested workloads on older hosts"],"tags":["vz-driver","nested-virtualization","macos-version"],"backgroundTag":"nested-virtualization-unsupported","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}