Systemd-udev-trigger fails and systemd-networkd doesn't work when using systemd 247 in a container

I got two computers running LXD, an arch linux one and an arch linux arm one. I’m using macvlan networking on them and the containers if it matters. I’m not using privileged containers. The arch linux arm system is not using AppArmor confinement but the arch linux one is. The problem is seen on both computers.

The problem is that in the container, systemd-udev-trigger.service is failing after “Failed to write ‘add’ to ‘/sys/bus/amba/uevent’: Permission denied” is recorded in the logs. systemd-networkd doesn’t work, running networkctl status eth0 shows it got iPv6LL or something but nothing else happens.

I can get networking with dhcpcd if I edit the service to remove the BindsTo= and After= part because otherwise starting dhcpcd will fail with dependency errors for sys-subsystem-net-devices-eth0.device: “Timed out waiting for device /sys/subsystem/net/devices/eth0”. I don’t understand this, there is no /sys/subsystem directory on ANY of my computers.

So I guess this isn’t too bad, I can just switch to using dhcpcd.

Seems LXD and systemd in containers have minor problems all the time. systemd-journald-audit.socket always fails in the container and I got some error when updating in pacman sometimes about ACL. If someone got pointers for a solution to all this systemd+LXD problems it would be appreciated also.

BTW, I tried using security.nesting but that doesn’t fix anything.

Until then, setting security.nesting: true on the instance should make systemd happier.

The thing is that systemd-udev-trigger.service still fails which breaks systemd-networkd even with security.nesting: true on the instance :<. Maybe it’s only an issue when using macvlan? Or that I’m using a custom image. I don’t know if the provided images for LXD have extra configuration files for workarounds but I might try them out. Cause I can’t find anyone having the same problem online.

Ah, so I do need to edit my custom image a bit to add some configuration changes like in https://github.com/lxc/lxc-ci/blob/master/images/archlinux.yaml. I added the /etc/systemd/system/systemd-networkd.service.d/lxc.conf file specifically, and systemd-networkd works now. I should keep an eye on that webpage in the future.

systemd-udev-trigger.service still fails though, but it doesn’t seem to affect me at all so I’ll leave it for now. Using security.nesting: true doesn’t seem to have a noticeable effect for me but I might see something later.