After the latest systemd upgrade, systemd-nspawn refused to run my
debootstrapped Debian Squeeze directory because it “doesn't look like an OS
It turned out that the OS detection logic changed from checking for the
DIR/bin/sh file to check the existence of DIR/etc/os-release file, so the
solution was easy enough, I had to create that file.
However, I don't think /etc/os-release is widespread enough to use it
exclusively, maybe systemd-nspawn could fallback to check /bin/sh if os-release
Or, if you stick to this decision, please put it in the man page or add a more
verbose error message, because I had to use strace to find out which file was
I have exactly the same issue. I think it is not a minor bug because if you don't known the workaround, it does not work at all for Debian (which is really common).
Actually, /etc/os-release is pretty universal these days, even Debian 7 and Ubuntu have it both. The older the distros get the more you have to modify them anyway before they run cleanly in a container, hence requiring the user to create this file on these older OSes doesn't sound like too much.
I have now changed git to document this behaviour in both the man page and the error message you get: