#1012458 No network connection: systemd-resolved fails to start on read-only filesystem

Package:
systemd
Source:
systemd
Description:
system and service manager
Submitter:
Date:
2022-06-09 21:39:07 UTC
Severity:
normal
#1012458#5
Date:
2022-06-07 17:37:09 UTC
From:
To:
Package: systemdVersion: 247.3-7Hi. I'm currently trying to put together an image to serve via PXE with mkosi.The tool creates a debian minbase variant with the sole addition of the kernel package, then "zips" the entire filesystem into a squashfs image.The image is then run on QEMU, the filesystem mounted as read-onlysystemd-resolved attempts to create a namespace but fails due to the filesystem being readonly. It's then restarted by systemd until it exceedes the restart limits and it's aborted, seemingly leaving the machine without internet accessJun 07 19:12:09 localhost systemd[1]: Starting Network Name Resolution...
Jun 07 19:12:09 localhost systemd[1]: Starting Network Name Resolution...
Jun 07 19:12:09 localhost systemd[375]: systemd-resolved.service: Failed to set up mount namespacing: /run/systemd/unit-root/dev: Read-only file system
Jun 07 19:12:09 localhost systemd[375]: systemd-resolved.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-resolved: Read-only file system
Jun 07 19:12:09 localhost systemd[1]: systemd-resolved.service: Main process exited, code=exited, status=226/NAMESPACE
Jun 07 19:12:09 localhost systemd[1]: systemd-resolved.service: Failed with result 'exit-code'.
Jun 07 19:12:09 localhost systemd[1]: Failed to start Network Name Resolution.
Jun 07 19:12:09 localhost systemd[1]: systemd-resolved.service: Scheduled restart job, restart counter is at 5.
Jun 07 19:12:09 localhost systemd[1]: Stopped Network Name Resolution.
Jun 07 19:12:09 localhost systemd[1]: systemd-resolved.service: Start request repeated too quickly.
Jun 07 19:12:09 localhost systemd[1]: systemd-resolved.service: Failed with result 'exit-code'.
Jun 07 19:12:09 localhost systemd[1]: Failed to start Network Name Resolution.
root@localhost:~#

Debian GNU/Linux 11 Linux 5.10.0-13-amd64 Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux

#1012458#14
Date:
2022-06-09 21:35:38 UTC
From:
To:
You can make /usr ro without problems, but /tmp and /var (and /etc most
likely as well) need to be writable at the very least.

A fully ro system is simply not supported.