{"record":{"id":"969573950dc183fa","repo":"lima-vm/lima","slug":"failed-to-create-a-new-rosetta-directory-share-cac","errorCode":null,"errorMessage":"failed to create a new rosetta directory share caching option: %w","messagePattern":"failed to create a new rosetta directory share caching option: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/vz/rosetta_directory_share_arm64.go","lineNumber":49,"sourceCode":"\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":31,"sourceCodeEnd":57,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/vz/rosetta_directory_share_arm64.go#L31-L57","documentation":"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.","triggerScenarios":"Creating/starting a VZ VM with the Rosetta directory share enabled on macOS 13.x or earlier, where vz.NewLinuxRosettaUnixSocketCachingOptions returns an error.","commonSituations":"Developers on macOS 13 (Ventura) running an instance template with rosetta enabled expecting caching behavior; VZ framework limitations on older macOS builds.","solutions":["Upgrade the host to macOS 14 (Sonoma) or newer — the caching option is only requested below 14 and works there.","On macOS 13, the driver skips caching by design; if the error persists, verify Rosetta is installed (`softwareupdate --install-rosetta`).","Disable Rosetta sharing in lima.yaml (remove rosetta enabled) and use binfmt/qemu emulation instead.","Check the underlying wrapped %w error for the exact VZ API failure cause."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const needsCaching = parseFloat(require('child_process')\n  .execSync('sw_vers -productVersion').toString()) < 14;\nif (needsCaching) console.warn('Rosetta caching unsupported on macOS < 14');","typeGuard":null,"tryCatchPattern":"// Go: distinguish version-gated API failures\nif macVer.LessThan(*semver.New(\"14.0.0\")) {\n    // expect the caching option may fail; handle gracefully\n}","preventionTips":["Upgrade to macOS 14+ before enabling Rosetta caching","Check macOS version before enabling rosetta in lima.yaml","Have a fallback without Rosetta for macOS 13 hosts"],"tags":["macos","vz-driver","rosetta"],"backgroundTag":"rosetta-caching-unsupported","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}