https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
chroot improved.
on arch - i needed qemu-user-static AUR. it takes FOREVER to biuld.
the conf files were absent and so systemd-binfmt (instead of binfmt-support) was failing to load. followed this and resolved: https://github.com/computermouth/qemu-static-conf/blob/master/README.md
create loopback of the raspberrypi.img file
sudo losetup -P -f --show some/path/to/raspbian.img
assuming loop0, mount the boot and rootfs
sudo mkdir-P /mnt/rpi
sudo mount /dev/loop0p2 /mnt/rpi
sudo mount /dev/loop0p1 /mnt/rpi/boot
spawn the os container
sudo systemd-nspawn --directory /mnt/rpi
BaBAM!
..now, do stuff. install packages. touch /boot/ssh
. add your wireless to wpa-suplicant.conf. change pi's password.
if you need to install a lot of packages, you may need to extend the partition first to give you more "disk space" to do stuff while in the choot envrionmnet.
you will need to do this prior to mounting the partitions.
sudo dd if=/dev/zero bs=1M count=1024 >> raspbian.img
to add 1GB to the original image.
run losetup to create the loopbacks (above)
use parted grow the rootfs into the newly created space.
sudo parted /dev/loop0 resizepart 2 100%
sudo e2fsck -f /dev/loop0p2
to check the disk (if you want).
sudo resize2fs /dev/loop0p2 -f
or without -f(orce).
now, mount and spawn.
https://blog.oddbit.com/post/2016-02-07-systemd-nspawn-for-fun-and-well-mostly-f/
https://docs.j7k6.org/raspberry-pi-chroot-armv7-qemu/
https://wiki.debian.org/RaspberryPi/qemu-user-static
https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=231762&p=1462118#p1462118