:: Re: [DNG] How to enable binfmt_misc…
Top Page
Delete this message
Reply to this message
Author: Tom
Date:  
To: dng
Subject: Re: [DNG] How to enable binfmt_misc on Excalibur
On 5/5/2026 14:07, Ralph Ronnquist via Dng wrote:
> On Tue, May 05, 2026 at 11:55:07AM +1000, Tom via Dng wrote:
>> I'm having trouble trying to enable binfmt_misc on Excalibur so I can run
>> multi-platform docker builds.
>>
>> I previously had it working on Daedalus by running
>>
>> # apt install binfmt-support qemu-user-static
>>
>> # ls /proc/sys/fs/binfmt_misc/
>> python3.11    qemu-alpha  qemu-armeb  qemu-hexagon  qemu-loongarch64
>> qemu-microblaze  qemu-mips64    qemu-mipsel   qemu-mipsn32el  qemu-ppc64
>> qemu-riscv32  qemu-s390x  qemu-sh4eb  qemu-sparc32plus  qemu-xtensa
>> register
>> qemu-aarch64  qemu-arm    qemu-cris   qemu-hppa     qemu-m68k qemu-mips
>> qemu-mips64el  qemu-mipsn32  qemu-ppc qemu-ppc64le  qemu-riscv64  qemu-sh4
>> qemu-sparc  qemu-sparc64 qemu-xtensaeb  status

>>
>>
>> When I try the same on a new Excalibur install I don't see the binfmt_misc
>> enabled.
>>
>> # ls /proc/sys/fs/binfmt_misc/
>> python3.13 register status
>
> Yes, you have to install "qemu-user" rather, and then register target
> archs from /usr/share/qemu/binfmt.d/ by hand, like
>
> # cat /usr/share/qemu/binfmt.d/qemu-aarch64.conf > /proc/sys/fs/binfmt_misc/register
>
> hth
>
> Ralph.

Thanks Ralph. Adding this script into /etc/boot.d/binfmt_misc with
execute bit set appears to get the job done and registers on system boot
through the /etc/init.d/rc.local service.

It also needs the binfmt-support package installed.

---8<---
#!/bin/sh -e

if test -d /usr/share/qemu/binfmt.d ; then
find /usr/share/qemu/binfmt.d/ -type f -name 'qemu-*.conf' ! -name
"qemu-$(uname -m).conf" -print0 | xargs -0 -I binfmt-file cat
binfmt-file > /proc/sys/fs/binfmt_misc/register
fi
---8<---

I found out the hard way that linux doesn't like the binfmt of the host
architecture to be registered :D, hence the `uname -m`. Thankfully grub
recovery was available to fix that in single user mode.

Tom