2

I would like to systemd-nspawn an Ubuntu image (yakkety, the host is on yakkety as well). This used to work without problems, so I guess something changed in the last ~6 months.

I created an image via debootstrap:

# debootstrap --variant=minbase --include=nano,dbus,isc-dhcp-client,iputils-ping,iproute2,python3 yakkety yakkety http://fr.archive.ubuntu.com/ubuntu

I then tried to start it:

# machinectl start yakkety

There was no error message but the container did not start. journalctl -xe exposed the error:

Feb 27 13:24:27 srv systemd-nspawn[27348]: execv(/usr/lib/systemd/systemd, /lib/systemd/systemd, /sbin/init) failed: No such file or directory

It looks like there is nothing to initialize? How is that possible with an image created via debootstrap? The image looks normal otherwise (it contains usual folders and binaries - except the ones above which could not be started as they are absent)

A direct call tosystemd-nspawn yields the same error:

# systemd-nspawn -b -D yakkety -n
Spawning container yakkety on /var/lib/machines/yakkety.
Press ^] three times within 1s to kill container.
execv(/usr/lib/systemd/systemd, /lib/systemd/systemd, /sbin/init) failed: No such file or directory
Container yakkety failed with error code 1.

I tried to recreate the image by adding the systemd and init packages to the luist of packages to be preinstalled (after python3 in my example above) but this did not chnage anything.

What is the problem? Are there extra packages I need to install? (I did not install anything special previously for xenial and, if I am not mistaken, neither for yakkety).

All packages are attheir latest version, including systemd (233).

1

You need to install an init system inside your container, for example systemd :

chroot /var/lib/machines/yakkety
apt-get install systemd

(i had the same problem on debian and that fixed the problem)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.