lima-vm/lima · error

failed to create a new rosetta directory share caching optio

Error message

failed to create a new rosetta directory share caching option: %w

What it means

On macOS < 14.0 the VZ driver additionally creates vz.NewLinuxRosettaUnixSocketCachingOptions("/run/rosettad/rosetta.sock") for the Rosetta directory share. On macOS 13 and older this API can fail (it was not fully supported before macOS 14), and the driver wraps and returns the error, aborting VM creation.

Source

Thrown at pkg/driver/vz/rosetta_directory_share_arm64.go:49

			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

  1. Upgrade the host to macOS 14 (Sonoma) or newer — the caching option is only requested below 14 and works there.
  2. On macOS 13, the driver skips caching by design; if the error persists, verify Rosetta is installed (`softwareupdate --install-rosetta`).
  3. Disable Rosetta sharing in lima.yaml (remove rosetta enabled) and use binfmt/qemu emulation instead.
  4. Check the underlying wrapped %w error for the exact VZ API failure cause.
Defensive patterns

Strategy: validation

Validate before calling

const needsCaching = parseFloat(require('child_process')
  .execSync('sw_vers -productVersion').toString()) < 14;
if (needsCaching) console.warn('Rosetta caching unsupported on macOS < 14');

Try / catch

// Go: distinguish version-gated API failures
if macVer.LessThan(*semver.New("14.0.0")) {
    // expect the caching option may fail; handle gracefully
}

Prevention

When it happens

Trigger: Creating/starting a VZ VM with the Rosetta directory share enabled on macOS 13.x or earlier, where vz.NewLinuxRosettaUnixSocketCachingOptions returns an error.

Common situations: Developers on macOS 13 (Ventura) running an instance template with rosetta enabled expecting caching behavior; VZ framework limitations on older macOS builds.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/969573950dc183fa. Report an issue: GitHub.