{"record":{"id":"0622bb97f118d1f4","repo":"abiosoft/colima","slug":"unable-to-disable-qemu-x86-84-emulation-w","errorCode":null,"errorMessage":"unable to disable qemu x86_84 emulation: %w","messagePattern":"unable to disable qemu x86_84 emulation: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"environment/vm/lima/lima.go","lineNumber":333,"sourceCode":"\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 {\n\t\t\tlogrus.Warnln(fmt.Errorf(\"unable to assign host IP addresses to the VM: %w\", err))\n\t\t}\n\t\treturn nil\n\t})\n\n\t// preserve state\n\ta.Add(func() error {\n\t\tif err := configmanager.SaveToFile(conf, config.CurrentProfile().StateFile()); err != nil {","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/vm/lima/lima.go#L315-L351","documentation":"After successfully registering Rosetta, Colima disables the competing qemu x86_64 binfmt handler (echo 0 into /proc/sys/fs/binfmt_misc/qemu-x86_64) so x86_64 binaries prefer fast Rosetta translation. Failure is only a warning (note the message's 'x86_84' typo); the chain continues and Rosetta registration from the prior step remains in effect, with the caveat that qemu may also be registered for the same magic, making handler precedence unpredictable.","triggerScenarios":"VZ+Rosetta on Apple Silicon where the qemu-x86_64 handler exists (stat succeeded) but writing 0 fails: read-only binfmt_misc, handler name differs, guest security policy. Purely a guest-side tweak, never fatal.","commonSituations":"Custom images with unusual binfmt handler names; hardened guests blocking binfmt writes; cosmetic noise users notice in logs.","solutions":["Ignore if x86_64 emulation works acceptably; this is best-effort de-duplication.","Verify and fix manually: `colima ssh -- cat /proc/sys/fs/binfmt_misc/qemu-x86_64` then `echo 0 | sudo tee /proc/sys/fs/binfmt_misc/qemu-x86_64`.","If qemu keeps winning over Rosetta, unregister it manually as above, or restart so registration order favors Rosetta.","On custom images, name the qemu handler qemu-x86_64 so Colima can disable it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Non-fatal warning; no action required. If qemu shadows Rosetta for x86_64, manually disable the handler: echo 0 | sudo tee /proc/sys/fs/binfmt_misc/qemu-x86_64 in the guest.","preventionTips":["Name the qemu handler qemu-x86_64 in custom images","Verify handler precedence with colima ssh -- cat /proc/sys/fs/binfmt_misc/status","Treat this warning as cosmetic unless x86_64 perf regresses"],"tags":["rosetta","qemu","binfmt","apple-silicon","colima","non-fatal"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}