{"record":{"id":"4f11176340c8d07c","repo":"lima-vm/lima","slug":"failed-to-get-macos-product-version-w-4f1117","errorCode":null,"errorMessage":"failed to get macOS product version: %w","messagePattern":"failed to get macOS product version: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/vm_darwin.go","lineNumber":351,"sourceCode":"\n\tplatformConfig, err := vz.NewGenericPlatformConfiguration(vz.WithGenericMachineIdentifier(machineIdentifier))\n\tif err != nil {\n\t\treturn nil, err\n\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}","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/vm_darwin.go#L333-L369","documentation":"attachPlatformConfig only enables nested virtualization when inst.Config.NestedVirtualization is true, and it first fetches the host macOS version to gate the feature. If osutil.ProductVersion() fails during this check, VM creation fails with this wrapped error.","triggerScenarios":"Starting a VZ instance with nestedVirtualization: true in lima.yaml on a host where the macOS version probe fails.","commonSituations":"Sandboxed or broken environments where sw_vers/SystemVersion.plist is unreadable; unusual macOS builds failing semver parse — only affects templates enabling nested virtualization.","solutions":["Verify `sw_vers -productVersion` works on the host.","Fix or avoid the environment that blocks OS version detection (run limactl directly, not inside a sandbox).","Upgrade macOS to a supported release.","If nested virtualization is not needed, set nestedVirtualization: false to skip this code path entirely."],"exampleFix":"// before (lima.yaml)\nnestedVirtualization: true\n// after (lima.yaml)\nnestedVirtualization: false","handlingStrategy":"validation","validationCode":"// verify version probe works before enabling nested virt\nsw_vers -productVersion && echo OK || echo \"probe broken; nested virt check will fail\"","typeGuard":null,"tryCatchPattern":"// Go: guard the config gate\nif *inst.Config.NestedVirtualization {\n    if _, err := osutil.ProductVersion(); err != nil {\n        return fmt.Errorf(\"nested virt requires a readable macOS version: %w\", err)\n    }\n}","preventionTips":["Set nestedVirtualization: false unless explicitly needed","Verify sw_vers works before limactl start","Keep macOS on a supported release"],"tags":["vz-driver","nested-virtualization","macos-version"],"backgroundTag":"macos-version-detection-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}