You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exec format error after Setting up QEMU User-Mode Emulation on ARM64 with Docker
#207
I'm encountering an issue while setting up QEMU user-mode emulation on my ARM64 machine using Docker. Here are the details:
$ uname -m
aarch64
$ sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
Setting /usr/bin/qemu-hexagon-static as binfmt interpreter for hexagon
$ uname -m
-bash: /usr/bin/uname: cannot execute binary file: Exec format error
And when I open another terminal window:
<3>WSL (790) ERROR: CreateProcessCommon:559: execvpe(/bin/bash) failed: Exec format error
[process exited with code 1 (0x00000001)]
Any insights on why this might be happening and how to resolve it would be greatly appreciated!
Thank you Martin for the reply. And apologies if it was a silly question. I have been trying for days!
I can now see the qemu emulators after following your blog post:
$ ls -ls /proc/sys/fs/binfmt_misc/
total 0
0 -rw-r--r-- 1 root root 0 Nov 28 09:46 WSLInterop
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 WSLInterop-late
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 arm
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 i386
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 mips64
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 mips64le
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 ppc64le
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-aarch64_be
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-alpha
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-arm
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-armeb
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-hexagon
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-hppa
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-i386
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-i486
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-m68k
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-microblaze
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-microblazeel
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mips
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mips64
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mips64el
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mipsel
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mipsn32
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-mipsn32el
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-or1k
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-ppc
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-ppc64
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-ppc64le
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-riscv32
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-riscv64
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-s390x
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-sh4
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-sh4eb
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-sparc
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-sparc32plus
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-sparc64
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-x86_64
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-xtensa
0 -rw-r--r-- 1 root root 0 Nov 28 09:48 qemu-xtensaeb
0 --w------- 1 root root 0 Nov 28 18:44 register
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 riscv64
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 s390x
0 -rw-r--r-- 1 root root 0 Nov 28 09:46 status
0 -rw-r--r-- 1 root root 0 Nov 28 09:47 x86_64
When I run a Docker file from Visual Studio (in debug mode) with a x86-64 base image, I get the following error:
"qemu-x86_64-static: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory"
$ls /lib64/ld-linux-x86-64.so.2
ls: cannot access '/lib64/ld-linux-x86-64.so.2': No such file or directory
$ docker run --rm -it --platform linux/x86_64 ubuntu:latest /bin/bash
root@fcb959ba906f:/# ls /lib64/ld-linux-x86-64.so.2
/lib64/ld-linux-x86-64.so.2
Any tips to resolve this would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I'm encountering an issue while setting up QEMU user-mode emulation on my ARM64 machine using Docker. Here are the details:
And when I open another terminal window:
Any insights on why this might be happening and how to resolve it would be greatly appreciated!
All reactions