containers / podman-bootc

Apache License 2.0
22 stars 9 forks source link

Unable to run amd64 image #27

Open cdrage opened 6 months ago

cdrage commented 6 months ago

I built an amd64 image using podman build --platform linux/amd64 -t fedora-helloworld-test .

I then tried running it with podman-bootc:

▶ podman-bootc run fedora-helloworld-test
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
ERROR Re-exec in host mountns: setns: EINVAL: Invalid argument
ERROR Installing to disk: Gathering source info from container env: Task podman inspect failed: ExitStatus(unix_wait_status(256))
Error: unable to install bootc image: failed to create disk image: failed to run bootc install
ckyrouac commented 6 months ago

just to clarify - are you trying to run an amd64 image on an arm64 device?

cdrage commented 6 months ago

Yup.

I'm expecting podman-bootc under the hood to choose qemu-system-aarch64 or qemu-system-x86_64 and run the image.

rhatdan commented 6 months ago

I don't believe that will work. You can not run a aarch64 VM/Kernel on an x86 box. Emulation works in user space not for the kernel, as I understand.

cfergeau commented 6 months ago

I don't believe that will work. You can not run a aarch64 VM/Kernel on an x86 box. Emulation works in user space not for the kernel, as I understand.

qemu can do both, qemu-system-aarch64 will emulate a full aarch64 VM, qemu-aarch64 will emulate user space binaries.

cgwalters commented 6 months ago

ERROR Re-exec in host mountns: setns: EINVAL: Invalid argument

The core problem here (and this has come up elsewhere) is that qemu's userspace emulation doesn't handle many Linux container features.

Here what we're trying to do is extract information about the container from the host podman. Hmm. Maybe we could switch to using data from the /var/lib/containers mount?

The other avenue here is we could use bootc-image-builder's flow in this case (or in general, by default), where it runs the install container with the host arch. That path is https://github.com/containers/podman-bootc/issues/4