<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>It seems very strange. systemd-nspawn should have nothing to do
with whether it is running in vm or what is the host of the vm.
Try to see what systemd-detect-virt see's in each case anyway.</p>
<p>For debugging, you can enter the nspawn container --boot and see
if cgroup fs is mounted the same in all cases. Also enter the
failing container and attach debugger (with follow on exec) to the
shell process (pid 1 inside container, attach from outside ofc)
and exec systemd to see exactly where it is failing. Good that you
have extremely similar systems with different results so you can
do differential debigging here.</p>
<p>(in case --boot adds other magic like podman --systemd flag, you
can drop a binary with sleep/shell at the systemd location in the
debian rootfs. Sorry, I haven't seen nspawn code since ages so
can't recall).<br>
</p>
<p>~ serene<br>
</p>
<div class="moz-cite-prefix">On 5/7/25 19:09, An Liu wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAzVxgMA8SHbsSirTvhCAiJvGXK8s7ZOSuHK++KizYwZhwNLkg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<br clear="all">
<div dir="auto">Hi,<br>
I'm playing systemd-nspawn, and something interesting happens. <br>
Try 1: host CentOS 8 Stream, systemd-nspawn to Debian Trixie<br>
everything goes well. <br>
<br>
Try 2: host CentOS 8 Stream , kvm guest CentOS 8 Stream<br>
a: in guest systemd-nspawn to Debian Trixie , nspawn is OK to
start without —boot</div>
<div dir="auto"> b: in guest systemd-nspawn to Debian Trixie with
--boot, nspawn failed nspawn failed due to failed to create
/init.scope</div>
<div dir="auto"><br>
</div>
<div dir="auto">Try 3: host Debian bookworm, kvm guest CenOS 8
Stream, nspawn to Trixie <br>
nspawn OK for whatever --boot present or not<br>
<br>
Can someone explain what lead to the different behavior, Can we
manage to fix it to make <br>
if so, what should we do. say, at the host side or at the kvm
guest side?<br>
<br>
<br>
Try 4: host centos 8 stream, kvm guest centos 8 stream, starts
with the same rootfs above but in pod man, this time systemd
could start as</div>
<div dir="auto"> pid 1</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks </div>
<br clear="all">
<div dir="auto">
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">Liu An <br>
</div>
</div>
</blockquote>
</body>
</html>