lima-vm/lima · error
failed to get macOS product version: %w
Error message
failed to get macOS product version: %w
What it means
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.
Source
Thrown at pkg/driver/vz/rosetta_directory_share_arm64.go:44
return nil, errRosettaUnsupported
case vz.LinuxRosettaAvailabilityNotInstalled:
logrus.Info("Installing rosetta...")
logrus.Info("Hint: try `softwareupdate --install-rosetta` if Lima gets stuck here")
if err := vz.LinuxRosettaDirectoryShareInstallRosetta(); err != nil {
return nil, fmt.Errorf("failed to install rosetta: %w", err)
}
logrus.Info("Rosetta installation complete.")
case vz.LinuxRosettaAvailabilityInstalled:
// nothing to do
}
rosettaShare, err := vz.NewLinuxRosettaDirectoryShare()
if err != nil {
return nil, fmt.Errorf("failed to create a new rosetta directory share: %w", err)
}
macOSProductVersion, err := osutil.ProductVersion()
if err != nil {
return nil, fmt.Errorf("failed to get macOS product version: %w", err)
}
if !macOSProductVersion.LessThan(*semver.New("14.0.0")) {
cachingOption, err := vz.NewLinuxRosettaUnixSocketCachingOptions("/run/rosettad/rosetta.sock")
if err != nil {
return nil, fmt.Errorf("failed to create a new rosetta directory share caching option: %w", err)
}
rosettaShare.SetOptions(cachingOption)
}
config.SetDirectoryShare(rosettaShare)
return config, nil
}
View on GitHub (pinned to dd909d0973)
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.
Defensive patterns
Strategy: validation
Validate before calling
// shell precheck on the macOS host sw_vers -productVersion || echo "OS version probe will fail in lima"
Try / catch
// Go: inspect the wrapped cause
if _, err := osutil.ProductVersion(); err != nil {
return fmt.Errorf("host cannot report macOS version: %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- failed to create a new rosetta directory share caching optio
- limactl is running under rosetta, please reinstall lima with
- cannot enable nested virtualization: %w
- networks.yaml '%s' configuration is only supported on macOS
- failed to create host audio output stream: %w
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/478289edaf8255ea.
Report an issue: GitHub.