Apple have forbidden magic coming down the pipe! (might need/benefit from some snapd support?)

Apple on the m1 and m2 CPU architecture (arm64-based but without armhf capability) has a feature in macOS called Rosetta that allows mac apps compiled for Intel to execute on the m1/m2 CPU via a minimal translation and hardware acceleration. macOS on m1/m2 supports ARM64 Linux VMs. Coming in the new macOS announced today is support via Linux’s binfmt_misc capability to route Intel binaries from an ARM64 Linux VM through to the host’s Rosetta to accelerate Intel Linux binaries inside the VM!

Basically the VM app in macOS mounts a specific directory from macOS into the Linux VM which contains a binfmt_misc handler executable that sends the Intel code through the VM boundary to Rosetta in macOS. The VM app then needs to configure the binfmt_misc support in the kernel inside the VM to route Intel binaries to the binfmt_misc handler.

Depending on how the binfmt_misc support is set up this might require that snapd expose the directory to Snapped apps if Intel binaries are to be supported. However, note that binfmt_misc can be configured that the handler need not be available in namespaces with the F (Fix Binary) flag, and I do see that the instructions on the link below indicate that the Fix Binary flag be used. So hopefully we don’t need to expose the mountpoint into snap mount namespaces.

Also it would require the ability for snapd to determine that it can execute Intel binaries on an ARM64 host when binfmt_misc is configured appropriately, such as in a macOS-hosted VM.

1 Like