systemd-nspawn has problems to start, when rootfs is dirty on some journal file check. Its easy to catch with btrfs snapshots (see below). And when journal is deleted it starts just fine. m_melnikau-M11xR3 max_posedon # btrfs subvolume snapshot / /.tmp Create a snapshot of '/' in '//.tmp' m_melnikau-M11xR3 max_posedon # systemd-nspawn -D /.tmp -b Spawning namespace container on /.tmp (console is /dev/pts/4). Init process in the container running as PID 3928. /etc/localtime is not a symlink, not updating container timezone. /.tmp/var/log/journal/be1598bd68baa268cb48e33d0000000f not empty. Container failed with error code 1 m_melnikau-M11xR3 max_posedon # rm -rf /.tmp/var/log/journal/be1598bd68baa268cb48e33d0000000f m_melnikau-M11xR3 max_posedon # systemd-nspawn -D /.tmp -b Spawning namespace container on /.tmp (console is /dev/pts/4). Init process in the container running as PID 4096. /etc/localtime is not a symlink, not updating container timezone. systemd 206 running in system mode. (+PAM +LIBWRAP -AUDIT -SELINUX +IMA -SYSVINIT -LIBCRYPTSETUP +GCRYPT +ACL +XZ) Detected virtualization 'systemd-nspawn'. Welcome to Gentoo/Linux! Set hostname to <m_melnikau-M11xR3>.
After doing few experiments I found out, that there is some issues with --link-journal=auto logic. m_melnikau-M11xR3 max_posedon # systemd-nspawn -D /.tmp -b --link-journal=no starting just fine
I experience similar issues with ext 4. Is there any workaround? I basically moved /mnt/wheezy to my home due to space concerns. Then, it got broken all of a sudden. sudo systemd-nspawn [sudo] password for lpapp: Spawning namespace container on /home/lpapp/Projects/chroot/wheezy (console is /dev/pts/1). Init process in the container running as PID 787. mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists mknod(/home/lpapp/Projects/chroot/wheezy) failed: File exists Container failed with error code 1.
Maksim: you most probably have the same machine id in host and guest. I just hit this and it looks the same as in your output. Changed to a more explicit message in http://cgit.freedesktop.org/systemd/systemd/commit/?id=4d680aeea. Laszlo: this looks like a different problem. Please file a separate bug.
(In reply to comment #3) > Maksim: you most probably have the same machine id in host and guest. I just > hit this and it looks the same as in your output. Yes, it is. This is exactly what btrfs snapshot do - making 1:1 writable copy. My usecase quite simple a) make btrfs snapshot, b) start it. And I would like that systemd will support this usecase. Thank you for fixing bug, I'll open more, if find smth interesting for such usecases.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.