Add binfmt_misc support for cross compilation


Let me know if I miss something, but it seems like binfmt_misc isn’t enabled.
When I’m installing qemu-user-static, I get:

Setting up qemu-user-static (1:2.1+dfsg-12+deb8u5a) ...
update-binfmts: warning: Couldn't load the binfmt_misc module.
update-binfmts: warning: Couldn't load the binfmt_misc module.

…and can’t run foreign binaries.
My current use case is building ARM docker images which requires me to run a native ARM binary. More specifically, I’m trying to build ARM alpine images:


+1 for the same reasons

just encountered that binfmt is not available for cross compilation

cat: /proc/sys/fs/binfmt_misc/status: No such file or directory
FATAL: Error inserting binfmt_misc (/lib/modules/3.13.0-85-generic/kernel/fs/binfmt_misc.ko): Operation not permitted


Is there any resolution to this issue? We have the same problem. It looks to me like binfmt_support is loaded as a package and /proc/sys/fs/binfmt_misc is properly mounted, but the kernel process doesn’t seem to be running. See and it looks like none of the files like register are alive.

Could you guys enable this in your kernel?


I have been able to run an ARMv7 docker image with a modified version of qemu on CircleCI. Qemu is integrated on the image and does not need to have a kernel which support binfmt_misc.
You can find it on show0k/miniconda-armv7.


Curious if anyone has this working with CircleCI 2.0 and the custom qemu from I’d love to see an example.