Skip to content

Instantly share code, notes, and snippets.

@ptrcnull
Last active January 2, 2022 03:16
Show Gist options
  • Save ptrcnull/266bce84835710bf8cff59c9654ebb12 to your computer and use it in GitHub Desktop.
Save ptrcnull/266bce84835710bf8cff59c9654ebb12 to your computer and use it in GitHub Desktop.
quick armv7 rootless "chroot" on alpine
sudo apk add qemu-arm qemu-openrc
sudo service qemu-binfmt restart
aria2c https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/armv7/alpine-minirootfs-3.15.0-armv7.tar.gz
dtrx alpine-minirootfs-3.15.0-armv7.tar.gz
rm alpine-minirootfs-3.15.0-armv7.tar.gz
mv alpine-minirootfs-3.15.0-armv7 chroot-arm
echo "nameserver 1.1.1.1" > chroot-arm/etc/resolv.conf
unshare -r -m -R chroot-arm /bin/ash -l
# binding a directory outside chroot
unshare -r -m sh -c "mount --bind test chroot-arm/mnt && chroot chroot-arm /bin/ash -l"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment