Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot nspawn raspbian 10 #16975

Closed
T35R6braPwgDJKq opened this issue Sep 7, 2020 · 1 comment
Closed

Cannot nspawn raspbian 10 #16975

T35R6braPwgDJKq opened this issue Sep 7, 2020 · 1 comment

Comments

@T35R6braPwgDJKq
Copy link

script to test

wget https://downloads.raspberrypi.org/raspios_lite_armhf_latest -o r.zip
unzip r.zip
LOOP=$(losetup --show -Pf *raspios-buster-armhf-lite.img)
mount ${LOOP}p2 /mnt
mount ${LOOP}p1 /mnt/boot
systemd-nspawn --bind /usr/bin/qemu-arm-static --boot --directory=/mnt

Output

Press ^] three times within 1s to kill container.
systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
Detected virtualization systemd-nspawn.
Detected architecture arm.

Welcome to Raspbian GNU/Linux 10 (buster)!

Set hostname to <raspberrypi>.
Initializing machine ID from container UUID.
Failed to process netlink event: Message too long
File /lib/systemd/system/systemd-journald.service:12 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[UNSUPP] Starting of Arbitrary Executable File Formats File System Automount Point not supported.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Reached target Swap.
[  OK  ] Listening on Syslog Socket.
[UNSUPP] Starting of /dev/serial1 not supported.
[DEPEND] Dependency failed for Configure Bluetooth Modems connected by UART.
hciuart.service: Job hciuart.service/start failed with result 'dependency'.
[  OK  ] Listening on Journal Socket.
         Mounting Huge Pages File System...
         Starting Journal Service...
         Starting Set the console keyboard layout...
         Starting Remount Root and Kernel File Systems...
         Starting Helper to synchronize boot up for ifupdown...
[  OK  ] Created slice system-getty.slice.
         Starting Restore / save the current clock...
         Mounting FUSE Control File System...
         Mounting RPC Pipe File System...
[  OK  ] Created slice User and Session Slice.
[  OK  ] Reached target Slices.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted RPC Pipe File System.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Started Helper to synchronize boot up for ifupdown.
Failed to receive notification message: Message too long
systemd-remount-fs.service: Main process exited, code=exited, status=1/FAILURE
systemd-remount-fs.service: Failed with result 'exit-code'.
[FAILED] Failed to start Remount Root and Kernel File Systems.
See 'systemctl status systemd-remount-fs.service' for details.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Restore / save the current clock.
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Started Set the console keyboard layout.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Preprocess NFS configuration...
         Starting Raise network interfaces...
         Starting Set console font and keymap...
nfs-config.service: Succeeded.
[  OK  ] Started Preprocess NFS configuration.
[  OK  ] Reached target NFS client services.
[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems.
[  OK  ] Started Set console font and keymap.
[  OK  ] Started Raise network interfaces.
[***   ] A start job is running for Journal Service (1min 29s / 1min 30s)
systemd-journald.service: Start operation timed out. Terminating.
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
[DEPEND] Dependency failed for Flush Journal to Persistent Storage.
systemd-journal-flush.service: Job systemd-journal-flush.service/start failed with result 'dependency'.
systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
systemd-journald.service: Scheduled restart job, restart counter is at 1.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...
[*     ] A start job is running for Journal Service (1min 29s / 1min 30s)
[**    ] A start job is running for Journal Service (1min 30s / 3min)
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
systemd-journald.service: Scheduled restart job, restart counter is at 2.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...
[ ***  ] A start job is running for Journal Service (1min 29s / 1min 30s)
[  *** ] A start job is running for Journal Service (1min 30s / 3min)
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
systemd-journald.service: Scheduled restart job, restart counter is at 3.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...
[    **] A start job is running for Journal Service (1min 29s / 1min 30s)
[     *] A start job is running for Journal Service (1min 30s / 3min)
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
systemd-journald.service: Scheduled restart job, restart counter is at 4.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...
[   ***] A start job is running for Journal Service (1min 29s / 1min 30s)
[  *** ] A start job is running for Journal Service (1min 30s / 3min)
[FAILED] Failed to start Journal Service.
See 'systemctl status systemd-journald.service' for details.
systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
systemd-journald.service: Scheduled restart job, restart counter is at 5.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...

That goes on and on

I'm running:

uname -a
Linux MArch 5.8.7-arch1-1 #1 SMP PREEMPT Sat, 05 Sep 2020 12:31:32 +0000 x86_64 GNU/Linux

systemd-nspawn --version 
systemd 246 (246.4-1-arch)
+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

Probably very easy to get this working, but it seems that I'm missing an important part

Any idea on what goes wrong?

@keszybz
Copy link
Member

keszybz commented Sep 7, 2020

mount ${LOOP}p1 /mnt/boot

You don't need /boot for nspawn...

systemd-nspawn --bind /usr/bin/qemu-arm-static --boot --directory=/mnt

So binaries from the host are mixed with libraries from the guest...

[***   ] A start job is running for Journal Service (1min 29s / 1min 30s)
systemd-journald.service: Start operation timed out. Terminating.
[FAILED] Failed to start Journal Service.

So that's the source of your problems. No idea why journald doesn't start. I'd suggest dropping into the image and trying to start to manually.

Anyway, let's close this here. This is a bug tracker, not a support forum. Feel free to write to the mailing list with problems like this.

@keszybz keszybz closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants