Bug#1115717: qemu-user-binfmt: fail to execute armhf binaries on arm64 (M1) via binfmt
Package: qemu-user-binfmt
Version: 1:10.0.3+ds-0+deb13u1
Severity: important
X-Debbugs-Cc: debian-arm@lists.debian.org
User: debian-arm@lists.debian.org
Usertags: arm64 armhf
Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
installing qemu-user and qemu-binfmt on a m1 Mac
* What exactly did you do (or not do) that was effective (or
ineffective)?
$ apt-get download busybox-static:armhf
Get:1 http://deb.debian.org/debian trixie/main armhf busybox-static armhf 1:1.37.0-6+b3 [829 kB]
Fetched 829 kB in 0s (6382 kB/s)
$ dpkg-deb -x busybox-static_1%3a1.37.0-6+b3_armhf.deb .
$ usr/bin/busybox
bash: usr/bin/busybox: cannot execute binary file: Exec format error
$ linux32
linux32: failed to set personality to linux32: Invalid argument
$ qemu-armhf usr/bin/busybox
BusyBox v1.37.0 (Debian 1:1.37.0-6+b3) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list[-full]
or: busybox --install [-s] [DIR]
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. The shell in this build
is configured to run built-in utilities without $PATH search.
You don't need to install a link to busybox for each utility.
To run external program, use full path (/sbin/ip instead of ip).
Currently defined functions:
[, [[, acpid, adjtimex, ar, arch, arp, arping, ascii, ash, awk, base64, basename, bc, blkdiscard, blockdev, brctl, bunzip2, busybox, bzcat, bzip2, cal, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crc32, crond, crontab,
cttyhack, cut, date, dc, dd, deallocvt, depmod, devmem, df, diff, dirname, dmesg, dnsdomainname, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep, env, expand, expr, factor, fallocate, false, fatattr, fdisk, fgrep, find,
findfs, fold, free, freeramdisk, fsfreeze, fstrim, ftpget, ftpput, getfattr, getopt, getty, grep, groups, gunzip, gzip, halt, head, hexdump, hostid, hostname, httpd, hwclock, i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer, id, ifconfig, ifdown,
ifup, init, insmod, install, ionice, ip, ipcalc, kill, killall, klogd, last, less, link, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsmod, lsscsi, lzcat, lzma, lzop, md5sum, mdev, microcom,
mim, mkdir, mkdosfs, mke2fs, mkfifo, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mt, mv, nameif, nbd-client, nc, netstat, nl, nologin, nproc, nsenter, nslookup, nuke, od, openvt, partprobe, passwd, paste, patch, pidof, ping,
ping6, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, resume, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, run-init, run-parts, sed, seq, setkeycodes, setpriv, setsid, sh, sha1sum, sha256sum, sha3sum,
sha512sum, shred, shuf, sleep, sort, ssl_client, start-stop-daemon, stat, strings, stty, su, sulogin, svc, svok, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tc, tee, telnet, telnetd, test, tftp, time, timeout,
top, touch, tr, traceroute, traceroute6, true, truncate, ts, tty, tunctl, ubirename, udhcpc, udhcpc6, udhcpd, uevent, umount, uname, uncompress, unexpand, uniq, unix2dos, unlink, unlzma, unshare, unxz, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, w, watch, watchdog, wc, wget, which, who, whoami, xargs, xxd, xz, xzcat, yes, zcat
$
$ ls /proc/sys/fs/binfmt_misc/
llvm-19-runtime.binfmt qemu-m68k qemu-or1k qemu-sparc
python3.13 qemu-microblaze qemu-ppc qemu-sparc32plus
qemu-aarch64_be qemu-microblazeel qemu-ppc64 qemu-sparc64
qemu-alpha qemu-mips qemu-ppc64le qemu-x86_64
qemu-armeb qemu-mips64 qemu-riscv32 qemu-xtensa
qemu-hexagon qemu-mips64el qemu-riscv64 qemu-xtensaeb
qemu-hppa qemu-mipsel qemu-s390x register
qemu-i386 qemu-mipsn32 qemu-sh4 status
qemu-loongarch64 qemu-mipsn32el qemu-sh4eb
* What was the outcome of this action?
directly calling the armhf binary does not work.
* What outcome did you expect instead?
Being able to run the armhf binary directly without needing to put it into as an
argument to qemu-armhf
Expecting it to work the same way to work as AMD64 binaries:
$ apt-get download busybox-static:amd64
Get:1 http://deb.debian.org/debian trixie/main amd64 busybox-static amd64 1:1.37.0-6+b3 [955 kB]
Fetched 955 kB in 0s (7354 kB/s)
$
$ dpkg-deb -x busybox-static_1%3a1.37.0-6+b3_amd64.deb .
$ usr/bin/busybox
BusyBox v1.37.0 (Debian 1:1.37.0-6+b3) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list[-full]
or: busybox --install [-s] [DIR]
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. The shell in this build
is configured to run built-in utilities without $PATH search.
You don't need to install a link to busybox for each utility.
To run external program, use full path (/sbin/ip instead of ip).
Currently defined functions:
[, [[, acpid, adjtimex, ar, arch, arp, arping, ascii, ash, awk, base64, basename, bc, blkdiscard, blockdev, brctl, bunzip2, busybox, bzcat, bzip2, cal, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crc32, crond, crontab,
cttyhack, cut, date, dc, dd, deallocvt, depmod, devmem, df, diff, dirname, dmesg, dnsdomainname, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep, env, expand, expr, factor, fallocate, false, fatattr, fdisk, fgrep, find,
findfs, fold, free, freeramdisk, fsfreeze, fstrim, ftpget, ftpput, getfattr, getopt, getty, grep, groups, gunzip, gzip, halt, head, hexdump, hostid, hostname, httpd, hwclock, i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer, id, ifconfig, ifdown,
ifup, init, insmod, install, ionice, ip, ipcalc, kill, killall, klogd, last, less, link, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsmod, lsscsi, lzcat, lzma, lzop, md5sum, mdev, microcom,
mim, mkdir, mkdosfs, mke2fs, mkfifo, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mt, mv, nameif, nbd-client, nc, netstat, nl, nologin, nproc, nsenter, nslookup, nuke, od, openvt, partprobe, passwd, paste, patch, pidof, ping,
ping6, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, resume, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, run-init, run-parts, sed, seq, setkeycodes, setpriv, setsid, sh, sha1sum, sha256sum, sha3sum,
sha512sum, shred, shuf, sleep, sort, ssl_client, start-stop-daemon, stat, strings, stty, su, sulogin, svc, svok, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tc, tee, telnet, telnetd, test, tftp, time, timeout,
top, touch, tr, traceroute, traceroute6, true, truncate, ts, tty, tunctl, ubirename, udhcpc, udhcpc6, udhcpd, uevent, umount, uname, uncompress, unexpand, uniq, unix2dos, unlink, unlzma, unshare, unxz, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, w, watch, watchdog, wc, wget, which, who, whoami, xargs, xxd, xz, xzcat, yes, zcat
$
-- System Information:
Debian Release: 13.1
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: arm64 (aarch64)
Foreign Architectures: amd64, armhf
Kernel: Linux 6.15.9+deb13-asahi (SMP w/8 CPU threads)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages qemu-user-binfmt depends on:
ii qemu-user 1:10.0.3+ds-0+deb13u1
Versions of packages qemu-user-binfmt recommends:
ii systemd 257.8-1~deb13u2
qemu-user-binfmt suggests no packages.
-- no debconf information
Reply to: