{"record":{"id":"e044f6d17f0187dd","repo":"abiosoft/colima","slug":"unable-to-enable-rosetta-w","errorCode":null,"errorMessage":"unable to enable rosetta: %w","messagePattern":"unable to enable rosetta: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"environment/vm/lima/lima.go","lineNumber":325,"sourceCode":"\t// registry certs\n\ta.Add(l.copyCerts)\n\n\t// cross-platform emulation\n\ta.Add(func() error {\n\t\t// use binfmt when emulation is disabled i.e. host arch\n\t\tif conf.Binfmt != nil && *conf.Binfmt {\n\t\t\tif arch := environment.HostArch(); arch == environment.Arch(conf.Arch).Value() {\n\t\t\t\tif err := core.SetupBinfmt(l.host, l, environment.Arch(conf.Arch)); err != nil {\n\t\t\t\t\tlogrus.Warn(fmt.Errorf(\"unable to enable qemu %s emulation: %w\", arch, err))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif l.limaConf.VMOpts.VZOpts.Rosetta.Enabled {\n\t\t\t// enable rosetta\n\t\t\terr := l.Run(\"sudo\", \"sh\", \"-c\", `stat /proc/sys/fs/binfmt_misc/rosetta || echo ':rosetta:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x3e\\x00:\\xff\\xff\\xff\\xff\\xff\\xfe\\xfe\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:/mnt/lima-rosetta/rosetta:OCF' > /proc/sys/fs/binfmt_misc/register`)\n\t\t\tif err != nil {\n\t\t\t\tlogrus.Warn(fmt.Errorf(\"unable to enable rosetta: %w\", err))\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\t// disable qemu\n\t\t\tif err := l.RunQuiet(\"stat\", \"/proc/sys/fs/binfmt_misc/qemu-x86_64\"); err == nil {\n\t\t\t\terr = l.Run(\"sudo\", \"sh\", \"-c\", `echo 0 > /proc/sys/fs/binfmt_misc/qemu-x86_64`)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogrus.Warn(fmt.Errorf(\"unable to disable qemu x86_84 emulation: %w\", err))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\n\t// replicate addresses when network address is disabled\n\ta.Add(func() error {\n\t\tif err := l.replicateHostAddresses(conf); err != nil {","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/lima.go#L307-L343","documentation":"On macOS Virtualization Framework with Rosetta enabled, Colima registers the Rosetta binfmt handler in the guest by echoing a magic/mask registration line into /proc/sys/fs/binfmt_misc/register (guarded by a stat so it is idempotent). On failure it only warns and returns nil, so start proceeds; x86_64 binaries on Apple Silicon will then fall back to slower qemu emulation or fail to run.","triggerScenarios":"VZ driver + rosetta enabled (`colima start --vz-rosetta` / config rosetta) on guests where binfmt_misc is unavailable or read-only, on Linux hosts (Rosetta is macOS-only and requires /mnt/lima-rosetta sharing), or when the rosetta binary mount is missing in the guest.","commonSituations":"Apple Silicon users with VZ+Rosetta on custom images lacking the rosetta mount; kernel/security settings blocking binfmt registration; expecting Rosetta on Linux hosts where it cannot work.","solutions":["Ensure prerequisites: macOS host, VZ driver (`--vm-type vz`), Rosetta support enabled, and the official image that mounts /mnt/lima-rosetta.","If Rosetta is not required, disable it (`--vz-rosetta=false`) to silence the warning and rely on qemu.","Verify inside the guest: `colima ssh -- ls /proc/sys/fs/binfmt_misc /mnt/lima-rosetta/rosetta`.","Update macOS/Colima; older VZ stacks had Rosetta issues resolved in later releases."],"exampleFix":"# before\ncolima start --vm-type vz --vz-rosetta   # warns: unable to enable rosetta\n\n# after (if Rosetta not needed)\ncolima start --vm-type vz --vz-rosetta=false","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Non-fatal (warn + return nil). If foreign-arch binaries are slow/failing afterwards, fall back to qemu by disabling Rosetta (--vz-rosetta=false).","preventionTips":["Rosetta requires macOS + VZ; don't enable on Linux hosts","Use official images so /mnt/lima-rosetta exists","Update macOS and Colima for current Rosetta support"],"tags":["rosetta","apple-silicon","vz","binfmt","colima","non-fatal"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}