Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to find binfmt_misc for qemu-arm under /proc/sys/fs/binfmt_misc #258

Open
shanduur opened this issue Jan 15, 2023 · 2 comments
Open

Comments

@shanduur
Copy link

I am facing this issue as in the title.

The environment:

Packer:

$ packer version
Packer v1.8.5

Kernel

$ uname -a
Linux rocky.dev 4.18.0-372.19.1.el8_6.x86_64 #1 SMP Tue Aug 2 16:19:42 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

OS

$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.5 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.5 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"

Installed Packages

$ sudo dnf list installed | grep qemu
ipxe-roms-qemu.noarch                             20200823-7.git4bd064de.el8                                @raven-extras          
libvirt-daemon-driver-qemu.x86_64                 8.2.0-1.el8                                               @raven-extras          
qemu-audio-alsa.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-audio-jack.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-audio-oss.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-audio-pa.x86_64                              15:7.0.0-2.el8                                            @raven-extras          
qemu-audio-sdl.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-audio-spice.x86_64                           15:7.0.0-2.el8                                            @raven-extras          
qemu-block-curl.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-block-dmg.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-block-gluster.x86_64                         15:7.0.0-2.el8                                            @raven-extras          
qemu-block-iscsi.x86_64                           15:7.0.0-2.el8                                            @raven-extras          
qemu-block-rbd.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-block-ssh.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-char-baum.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-char-spice.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-common.x86_64                                15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-qxl.x86_64                    15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-gpu.x86_64             15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-gpu-gl.x86_64          15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-gpu-pci.x86_64         15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-gpu-pci-gl.x86_64      15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-vga.x86_64             15:7.0.0-2.el8                                            @raven-extras          
qemu-device-display-virtio-vga-gl.x86_64          15:7.0.0-2.el8                                            @raven-extras          
qemu-device-usb-host.x86_64                       15:7.0.0-2.el8                                            @raven-extras          
qemu-device-usb-redirect.x86_64                   15:7.0.0-2.el8                                            @raven-extras          
qemu-device-usb-smartcard.x86_64                  15:7.0.0-2.el8                                            @raven-extras          
qemu-img.x86_64                                   15:6.2.0-11.module+el8.6.0+1000+18e3b59f.5                @appstream             
qemu-kvm.x86_64                                   15:7.0.0-2.el8                                            @raven-extras          
qemu-system-arm.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-system-arm-core.x86_64                       15:7.0.0-2.el8                                            @raven-extras          
qemu-system-x86.x86_64                            15:7.0.0-2.el8                                            @raven-extras          
qemu-system-x86-core.x86_64                       15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-curses.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-egl-headless.x86_64                       15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-gtk.x86_64                                15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-opengl.x86_64                             15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-sdl.x86_64                                15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-spice-app.x86_64                          15:7.0.0-2.el8                                            @raven-extras          
qemu-ui-spice-core.x86_64                         15:7.0.0-2.el8                                            @raven-extras          
qemu-user.x86_64                                  15:7.0.0-2.el8                                            @raven-extras          
qemu-user-binfmt.x86_64                           15:7.0.0-2.el8                                            @raven-extras

Debug Logs

Full log acquired with PACKER_LOG=1 (PACKER_LOG=1 sudo -E packer build boards/raspberry-pi/raspios-lite-arm.json)

packer.log

@csmithson12345
Copy link

i have run into this as well.
ubuntu_server_20.04_arm64.json /hcl works
my updated ubuntu_server_22.04_arm64.json /hcl does not. i have updated the file url's to hit the 22.04 images.

@ph20
Copy link

ph20 commented Jan 1, 2024

It's because the plugin can't find the registered qemu-arm-static binary.
This issue is related to the operating system specifics; in my case, on an Arch Linux host, it was fixed by installing the package qemu-user-static-binfmt, which contains the necessary orders for registering.
In another case, you might incorrectly set the qemu_binary_source_path = "/usr/bin/qemu-arm-static".
I'm not sure, but I think it can be fixed by running this script: https://gist.github.com/yuanfang-chen/d3ad4959727bbab8682e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants