3 ms·
systemd-nspawn is also worth looking into
by jovial_cavalier 3y ago
systemd-nspawn is also worth looking into
- johndoe0815 3y agoHow would that work? The problem here is that chroot needs to run using a different CPU instruction set. qemu-user is exactly the right answer here. According to e.g. https://wiki.gentoo.org/wiki/Systemd-nspawn https://wiki.gentoo.org/wiki/Systemd-nspawn "no hardware emulation is taking place and unlike QEMU and Virtualbox non-native CPU instruction sets are not directly supported".
- dijit 3y agosystemd-nspawn is still using binfmt which is how Linux tries to read ELF files, and what you really want when executing other architectures is to teach binfmt about qemu. nspawn doesn't do anything additional here, but might be easier for most new sysadmins (sorry... "devops/platform/cloud engineers"). More info (from 2016 so it could be out of date): https://blog.oddbit.com/post/2016-02-07-systemd-nspawn-for-fun-and-wel/ https://blog.oddbit.com/post/2016-02-07-systemd-nspawn-for-f...
- jovial_cavalier 3y agocd into an OS image built for arm on your x86 dev machine, and type: `systemd-nspawn -D .` and it just works. At least it's never failed for me. I believe it pulls in some kind of binfmt/qemu shim to get these binaries working. Probably qemu under the hood, but this is about as plug-n-play as it gets.
- deleted 3y ago[deleted]