Repository navigation
Description
Describe the bug
systemctl daemon-reload inside an amd64 Linux Machine (Rosetta) consistently takes ~5.5 s, while the
same command inside an arm64 Machine of the same distro takes ~0.13 s.
The whole delay is in the system-generators phase and is caused by the image-provided
/etc/systemd/system-generators/lxc script (distrobuilder's LXC/Incus generator). It is present in the image
for both architectures and actually executes because PID 1's environment contains container=lxc (by design).
It runs several hundred short-lived commands; under Rosetta each exec costs ~6 ms instead of ~0.22 ms, and the
combined cost lands on every daemon-reload (and at boot, where generators also run). Renaming that single
file drops daemon-reload to ~0.37 s; restoring it brings ~5.5 s back.
| Component | Value |
|---|---|
| OrbStack | 2.2.5 (2020500), commit bf842321f95fc3ca7cda3227bf0cd41cb188c471 |
| macOS | 26.5.2 (Darwin 25.5.0), Apple M4 Pro |
| Machine | orb create -a amd64 debian:bookworm <name> — Debian GNU/Linux 12.15 |
| systemd | 252 (252.39-1~deb12u2) |
| Kernel inside machine | Linux <name> 7.2.12-orbstack-00394-gbecdd6130068 ... x86_64 |
To Reproduce
orb create -a amd64 debian:bookworm orbdr
# with the image's lxc system-generator (as shipped)
orb -m orbdr sudo bash -c 'for i in 1 2 3; do
s=$(date +%s%N); systemctl daemon-reload; e=$(date +%s%N)
echo "$(( (e-s)/1000000 )) ms"; done'
# 5620 ms
# 5768 ms
# 5769 ms
# same machine, lxc system-generator moved aside
orb -m orbdr sudo bash -c '
mv /etc/systemd/system-generators/lxc /root/lxc.disabled
for i in 1 2 3; do
s=$(date +%s%N); systemctl daemon-reload; e=$(date +%s%N)
echo "$(( (e-s)/1000000 )) ms"; done
mv /root/lxc.disabled /etc/systemd/system-generators/lxc'
# 376 ms
# 396 ms
# 371 msReproduced on two independent amd64 Machines: 5 512–5 768 ms with the generator, 329–396 ms without.
An arm64 Machine with the identical generator file: 132–193 ms.
Expected behavior
systemctl daemon-reload should take on the order of a few hundred milliseconds (it does on the arm64
Machine: ~150 ms), not ~5.5 s. An amd64 Machine should not be ~30x slower for a command that mostly spawns
short-lived processes.
Diagnostic report (REQUIRED)
✔️➜ orb report
Diagnostic report saved to: /Users/sasha/.orbstack/diag/orbstack-diagreport_2026-11-14T20-19-02.968302Z.zip
Review report contents before uploading [y/N]? y
Report opened in a new Finder window.
Upload [Y/n]? y
OrbStack info:
Version: 2.2.5
Commit: bf842321f95fc3ca7cda3227bf0cd41cb188c471 (v2.2.5)
System info:
macOS: 26.5.2 (25F84)
CPU: arm64, 14 cores
CPU model: Apple M4 Pro
Model: Mac16,8
Memory: 24 GiB
Full report: https://orbstack.dev/_admin/diag/orbstack-diagreport_2026-11-14T20-19-02.968302Z.zip
---------------- [ cut here ] ----------------
Please copy and paste this into your bug report.
Open an issue here: https://github.com/orbstack/orbstack/issues/new/choose
Screenshots and additional context (optional)
Where the time goes. systemctl log-level debug + journalctl -o short-precise shows a single 5.1 s gap
inside the generators phase:
23:03:58.922337 systemd[1]: Successfully forked off '(sd-executor)' as PID 4458.
23:04:04.057107 systemd[1]: (sd-executor) succeeded. <-- +5.13 s
23:04:04.057155 systemd[1]: Looking for unit files in (higher priority first):
This is not CPU time: PID 1 accumulates ~0.27 s of CPU per daemon-reload, and the sum over all processes on
the machine is ~0.35 s per reload — it is waiting, not computing.
Process tree snapshot, 2 s into a reload — every other generator has already finished (zombies), only the
lxc generator is still in the phase, and its subshell has burned ~2.9 s of CPU:
1 /sbin/init do_wait
└ 17231 (sd-executor) do_wait
├ 17232 /bin/sh /etc/systemd/system-generators/lxc … do_wait
│ └ 17248 /bin/sh /etc/systemd/system-generators/lxc … do_wait, CPU 2.87 s
└ 17233..17244 (12 zombies: the other generators already finished)
Process-spawn cost under emulation (50 × /bin/true, and the same generator run by hand):
| measurement | amd64 Machine (Rosetta) | arm64 Machine |
|---|---|---|
50 × /bin/true |
304 ms (~6.1 ms/exec) | 11 ms (~0.22 ms/exec) |
sh /etc/systemd/system-generators/lxc /run/systemd/generator{,.early,.late} |
~730 ms | ~39 ms |
systemctl daemon-reload |
~5 500 ms | ~150 ms |
The generator executes 327 traced commands with sh -x (systemd --version, find, grep, ln -sf,
mkdir -p, readlink, …). It is not owned by any package — dpkg -S /etc/systemd/system-generators/lxc
reports no path — so it comes from the image itself.
Honest caveat: I could not fully attribute the remaining gap between the ~730 ms standalone generator run
and the ~5.2 s spent in the same phase under systemd (possibly per-exec overhead inside the sandboxed
generator plus all generators running in parallel). strace/perf are not usable inside the emulated
Machine — syscalls are misdecoded (e.g. syscall_0xf00018779c80), so that part is observation only.
Impact: any automation that reloads the unit database pays ~5.5 s per call instead of ~0.2 s. In our case
each unit-file write is followed by daemon-reload, which adds tens of seconds to a single operation on a test
stand.
Workaround we use: sudo mv /etc/systemd/system-generators/lxc /root/ in amd64 Machines →
daemon-reload drops from ~5.5 s to ~0.37 s.
Possibly related: #2744 (AMD64/Rosetta performance regression), though that one is about general compute,
not systemd/exec.
Activity