This might actually be apparmor on the LXD host denying the container? Look for messages like:
2023-06-23T09:53:56.040427+08:00 grook kernel: [772843.931461] audit: type=1400 audit(1687485236.036:118): apparmor="DENIED" operation="file_lock" profile="lxd-pat_</var/lib/lxd>" pid=3334600 comm="(.plocate)" family="unix" sock_type="dgram" protocol=0 requested_mask="send" 2023-06-23T09:53:56.040437+08:00 grook kernel: [772843.931469] audit: type=1400 audit(1687485236.036:119): apparmor="DENIED" operation="file_lock" profile="lxd-pat_</var/lib/lxd>" pid=3334600 comm="(.plocate)" family="unix" sock_type="dgram" protocol=0 requested_mask="send" In my case, plocate-updatedb.service (and systemd-hostnamed.service) fails to run inside containers when PrivateNetwork is enabled). See also https://bugs.debian.org/1038315 ** Bug watch added: Debian Bug tracker #1038315 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038315 -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to systemd in Ubuntu. https://bugs.launchpad.net/bugs/1635382 Title: PrivateNetwork=yes (hostnamed, localed) does not work in lxd Status in systemd package in Ubuntu: Won't Fix Bug description: $ lxc launch ubuntu-daily:yakkety y-hostname1 $ sleep 10 $ lxc exec y-hostname1 -- hostnamectl set-hostname smoser <hang> Could not set property: Connection timed out $ lxc exec y-hostname1 -- systemctl status --no-pager -l systemd-hostnamed ● systemd-hostnamed.service - Hostname Service Loaded: loaded (/lib/systemd/system/systemd-hostnamed.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2016-10-20 19:19:16 UTC; 1min 9s ago Docs: man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5) http://www.freedesktop.org/wiki/Software/systemd/hostnamed Process: 561 ExecStart=/lib/systemd/systemd-hostnamed (code=exited, status=225/NETWORK) Main PID: 561 (code=exited, status=225/NETWORK) Oct 20 19:19:16 y-hostname1 systemd[1]: Starting Hostname Service... Oct 20 19:19:16 y-hostname1 systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=225/NETWORK Oct 20 19:19:16 y-hostname1 systemd[1]: Failed to start Hostname Service. Oct 20 19:19:16 y-hostname1 systemd[1]: systemd-hostnamed.service: Unit entered failed state. Oct 20 19:19:16 y-hostname1 systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'. ProblemType: Bug DistroRelease: Ubuntu 16.10 Package: systemd 231-9git1 ProcVersionSignature: Ubuntu 4.8.0-22.24-generic 4.8.0 Uname: Linux 4.8.0-22-generic x86_64 ApportVersion: 2.20.3-0ubuntu8 Architecture: amd64 Date: Thu Oct 20 19:02:29 2016 ProcEnviron: TERM=xterm-256color PATH=(custom, no user) ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.8.0-22-generic.efi.signed root=UUID=f897b32a-eacf-4191-9717-844918947069 ro quiet splash vt.handoff=7 SourcePackage: systemd UpgradeStatus: No upgrade log present (probably fresh install) dmi.bios.vendor: Intel Corporation To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1635382/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp