Grr... it works if I first run a dummy command within the machine:
systemd-nspawn -M jammy-rootfs --as-pid2 passwd root machinectl start jammy-rootfs # it's working now! machinectl login jammy-rootfs
(Even just "echo hello world" does the job)
However if you go back to a *fresh* image then it fails:
machinectl stop jammy-rootfs machinectl remove jammy-rootfs machinectl pull-raw http://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img jammy-rootfs # Both of these commands consistently fail: machinectl start jammy-rootfs systemd-nspawn -M jammy-rootfs -U -b -n
Conclusion: this is confusing. The solution is to manually spawn any command within the image, *before* attempting to start the image with --boot.
Grr... it works if I first run a dummy command within the machine:
systemd-nspawn -M jammy-rootfs --as-pid2 passwd root
machinectl start jammy-rootfs # it's working now!
machinectl login jammy-rootfs
(Even just "echo hello world" does the job)
However if you go back to a *fresh* image then it fails:
machinectl stop jammy-rootfs cloud-images. ubuntu. com/jammy/ current/ jammy-server- cloudimg- amd64.img jammy-rootfs
machinectl remove jammy-rootfs
machinectl pull-raw http://
# Both of these commands consistently fail:
machinectl start jammy-rootfs
systemd-nspawn -M jammy-rootfs -U -b -n
Conclusion: this is confusing. The solution is to manually spawn any command within the image, *before* attempting to start the image with --boot.