I am using LXC containers for a long time without problems. Recently, I wanted to create a new LXC container. While the creation worked without issue, once attached to the container I had no network connectivity. Looking into it in more detailed, I got strange results when wanting to edit
/etc/resolv.conf inside the container. Hence, I detached and had a look at the container’s file system from outside.
ls -la /srv/lxc/[container]/rootfs/etc/ gives me multiple invalid symbolic links:
lrwxrwxrwx 1 root root 27 Oct 26 01:53 localtime -> /usr/share/zoneinfo/Etc/UTC lrwxrwxrwx 1 root root 19 Oct 26 01:52 mtab -> ../proc/self/mounts lrwxrwxrwx 1 root root 39 Oct 26 01:53 resolv.conf -> ../run/systemd/resolve/stub-resolv.conf lrwxrwxrwx 1 root root 13 May 18 22:50 rmt -> /usr/sbin/rmt lrwxrwxrwx 1 root root 23 Feb 24 2023 vtrgb -> /etc/alternatives/vtrgb
Could it be that there is an issue in the templates when setting up a new container?
For completeness, my
lxc.net.0.type = veth lxc.net.0.link = br-lan lxc.net.0.flags = up lxc.net.0.name = eth0 # # Some workarounds lxc.include = /usr/share/lxc/config/common.conf lxc.hook.start-host = /usr/share/lxc/hooks/systemd-workaround # Template to generate fixed MAC address lxc.net.0.hwaddr = x2:xx:xx:xx:xx:xx