{"record":{"id":"478289edaf8255ea","repo":"lima-vm/lima","slug":"failed-to-get-macos-product-version-w","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/rosetta_directory_share_arm64.go","lineNumber":44,"sourceCode":"\t\treturn nil, errRosettaUnsupported\n\tcase vz.LinuxRosettaAvailabilityNotInstalled:\n\t\tlogrus.Info(\"Installing rosetta...\")\n\t\tlogrus.Info(\"Hint: try `softwareupdate --install-rosetta` if Lima gets stuck here\")\n\t\tif err := vz.LinuxRosettaDirectoryShareInstallRosetta(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to install rosetta: %w\", err)\n\t\t}\n\t\tlogrus.Info(\"Rosetta installation complete.\")\n\tcase vz.LinuxRosettaAvailabilityInstalled:\n\t\t// nothing to do\n\t}\n\n\trosettaShare, err := vz.NewLinuxRosettaDirectoryShare()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create a new rosetta directory share: %w\", err)\n\t}\n\tmacOSProductVersion, err := osutil.ProductVersion()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get macOS product version: %w\", err)\n\t}\n\tif !macOSProductVersion.LessThan(*semver.New(\"14.0.0\")) {\n\t\tcachingOption, err := vz.NewLinuxRosettaUnixSocketCachingOptions(\"/run/rosettad/rosetta.sock\")\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create a new rosetta directory share caching option: %w\", err)\n\t\t}\n\t\trosettaShare.SetOptions(cachingOption)\n\t}\n\tconfig.SetDirectoryShare(rosettaShare)\n\n\treturn config, nil\n}\n","sourceCodeStart":26,"sourceCodeEnd":57,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/rosetta_directory_share_arm64.go#L26-L57","documentation":"Lima's VZ driver calls vz.NewLinuxRosettaDirectoryShare() to expose host Rosetta to the Linux guest, then reads the host macOS version via osutil.ProductVersion() to decide whether caching options can be applied. If the OS version cannot be determined, VM creation aborts with this wrapped error. It indicates a failure of the host OS version probe, not a Rosetta or VM configuration problem.","triggerScenarios":"Starting an instance with the VZ driver on arm64 when osutil.ProductVersion() fails — e.g. sw_vers cannot be executed, or ProductVersion's plist/NSProcessInfo lookup fails on the host.","commonSituations":"Running limactl in a stripped-down or sandboxed environment on macOS where system version info is unavailable; unusual macOS builds (beta/patch versions) whose version string fails semver parsing; corrupted /System/Library/CoreServices/SystemVersion.plist.","solutions":["Confirm `sw_vers -productVersion` returns a valid version like `14.5.0` in the same shell/environment.","Upgrade macOS to a normal release build so ProductVersion resolves; check SystemVersion.plist is intact.","Retry limactl outside sandboxes/wrappers that block system info access.","Disable the Rosetta directory share in the instance config (no rosetta requirement) to skip this code path if on x86_64 or rosetta: false."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// shell precheck on the macOS host\nsw_vers -productVersion || echo \"OS version probe will fail in lima\"","typeGuard":null,"tryCatchPattern":"// Go: inspect the wrapped cause\nif _, err := osutil.ProductVersion(); err != nil {\n    return fmt.Errorf(\"host cannot report macOS version: %w\", err)\n}","preventionTips":["Verify sw_vers works in the environment before running limactl","Avoid sandboxed wrappers that block system info access","Keep macOS on a normal release build"],"tags":["macos","vz-driver","rosetta"],"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"}