I'm really struggling to understand what's to blame with chroot / qemu not work on Ubuntu 18.04. Later editions work (definitely by 19.10) but under 18.04 I get:
cannot run command '/bin/sh' No such file or directory.
I can't work out what's actually broken. I can invoke the armhf binaries without trying to chroot and everything works fine. I can download an x86_64 equivalent for the same environment and chroot into it. But I can't chroot into an armhf environment.
I really want to be able to fix this without fully upgrading the box to a non-LTS release. If I can patch just one thing (even "just" the kernel) then I'm comfortable doing this; but without knowing what's actually broken I'm just stumbling round in the dark.
To reproduce the error:
qemu-user-staticon an x86_64 Ubuntu 18.04 machine.
sudo apt-get install qemu-user-static
- download an arm chroot environment (eg: alpine mini root file system armhf)
- extract and chroot into the environment
mkdir my_env cd my_env tar -xf ../alpine-minirootfs-3.11.3-armhf.tar.gz chroot . /bin/sh