qus icon indicating copy to clipboard operation
qus copied to clipboard

Can I run x86 docker images on Raspberry Pi 4 with this?

Open bitcoinmeetups opened this issue 1 year ago • 1 comments

Hi,

I'm Mr. Hologram, a very friendly guy.

Can I run x86 docker images on Raspberry Pi 4 with this?

You don't mention aarch64 in the supported systems list but you suggest using qus here:

https://forums.raspberrypi.com/viewtopic.php?t=281532

bitcoinmeetups avatar Nov 29 '23 15:11 bitcoinmeetups

aarch64 is supported! I also wrote an article about this few years ago - https://martin-grigorov.medium.com/build-linux-software-for-foreign-cpu-architectures-on-arm64-463a95d15460

martin-g avatar Nov 30 '23 11:11 martin-g

You don't mention aarch64 in the supported systems list

We do list aarch64 as explicitly supported. The README says:

Ready-to-use docker images are provided for each of seven host architectures officially supported by Docker, Inc. or built by official images (docker-library/official-images: Architectures other than amd64?): amd64, i386, arm64v8, arm32v7, arm32v6, s390x and ppc64le.

Note that different projects use different keywords/terms to refer to architectures (instruction sets). arm64v8 is equal to aarch64. More precisely, AArch64 or ARM64 is the 64-bit extension of the ARM architecture that was first introduced in the Armv8-A architecture, while AArch32 is used to refer to previous 32-bit architectures. For several years, all AArch64 (ARM64V8) devices could also execute AArch32 natively, however, nowadays AArch64 only devices exist, which do need emulation in order to run 32-bit ARM binaries.

This project (i.e. Docker/Podman and QEMU) supports running amd64/x86_64 on Armv8 devices or AArch32 binaries on AArch64 only devices, or any of those seven architectures on any of the others.

umarcor avatar May 25 '24 00:05 umarcor

Could you please provide a working example one-liner to run a simple GUI x86 Docker package on Raspberry Pi 4?

#CrossingLegs

bitcoinmeetups avatar May 25 '24 00:05 bitcoinmeetups

@bitcoinmeetups the example in the README will do: https://github.com/dbhi/qus?tab=readme-ov-file#setup

docker run --rm --privileged aptman/qus -s -- -p

That will register all foreign interpreters: i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb microblaze microblazeel or1k x86_64.

If you want x86_64 only, specify it at the end:

docker run --rm --privileged aptman/qus -s -- -p x86_64

Then, just execute any x86_64 binary on the host. Executing any docker/podman/OCI container is just executing binaries within some namespace.

umarcor avatar May 25 '24 01:05 umarcor

The GUI is a different matter, not explicitly covered in this repository/project. The fact that GUIs cannot be executed on containers by default is a known limitation and lots of research went into it. Some use VNC, some propietary tools expose GUIs through browsers similarly (e.g. Matlab), Gtk has broadway, etc. The solution I most like is x11docker, which runs a window server on the host and shares it with the container, so that GUIs of tools executed inside the container are shown on the host as just one additional window.

umarcor avatar May 25 '24 01:05 umarcor