Hi,
I configured NixOS to emulate aarch64 with:
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
However, when I try to create an ARM container (“chroot” into an ARM root filesystem) with systemd-nspawn
, I get the error that no shell was found, even though these files exist:
# systemd-nspawn -D ./arm-root
execv(/bin/bash, /bin/bash, /bin/sh) failed: No such file or directory
Do you know if the NixOS option mentioned above uses QEMU static user mode emulation? With Arch Linux, one can install qemu-user-static-binfmt
and running systemd-nspawn
works. Any Ideas, how I could achieve this with NixOS?
Here are the steps I followed (taken from The Simplest Way To Create an ARM Chroot in Arch Linux - nerdstuff.org):
- Download an image from Arch Linux ARM
- Create a folder that you want to use as root for the “chroot” environment.
$ mkdir ./arm-root - Extract the image files from the archive into that folder:
$ bsdtar -xpf -C ./arm-root - Make the new root folder a mount point (not sure if this is required):
$ mount --bind ./arm-root ./arm-root - “chroot”
$ sudo systemd-nspawn -D ./arm-root