Since a few weeks one of our servers that is running LXD 6.1-efad198 has a problem with IPv4 addresses. They are not longer configured. IPv6 still works.
And if I have the exact same container(s) on another LXD servers are works fine.
I have tried multiple settings/etc but nothing helped. The firewall/ufw rules are setup as described in the docs. I even tried with disabled ufw and apparmor.
Tried it with a fresh ubuntu:12.04 image. That container does not get an IP too. But with ubuntu:24.04 it does! So something is not playing nice with older version of Ubuntu / Linux.
So then I found out that there is a new fork of lxd: incus.
I hoped that migrating to incus from lxd fixed my IP issue. It did not
root@oev4 ~ # tshark -i lxdbr0 -n
Running as user “root” and group “root”. This could be dangerous.
Capturing on ‘lxdbr0’
** (tshark:2551528) 13:07:20.775129 [Main MESSAGE] – Capture started.
** (tshark:2551528) 13:07:20.775165 [Main MESSAGE] – File: “/tmp/wireshark_lxdbr0YQTRS2.pcapng”
How did you manually import the images into Incus? I am in mid-writing a post on how to import those images in Incus as I think it’s a somewhat involved task. If it’s too easy, I’ll switch to something else.
Regarding the core issue that you are facing, I think it is related to a recent discussion (within last two months) on this forum where old images where using some old style of cgroups vs cgroupsv2 (or AppArmor, or something like that) and this would not allow the instance to get an IPv4 address. Normally when I read the posts on this forum, I click to add a bookmark of such interesting discussions. I just searched my bookmarks in this forum and I could not find that discussion.
Let’s see how to manually add the old Ubuntu 12.04 image as a container in Incus.
We need two files found at Ubuntu 12.04.5 LTS (Precise Pangolin) Note that this site is HTTP and it may stall on some browsers. It’s the -lxd.tar.gz file with metadata and the -root.tar.xz with the rootfs / runtime.
Then, we import to Incus, and finally launch such a container.
I can then just set the network settings manually (using ifconfig, route and add a nameserver in /etc/resolv.conf), and networking works!
$ incus shell myinstance-1204
root@myinstance-1204:~# ifconfig eth0 10.10.10.199
sudo: unable to resolve host myinstance-1204
root@myinstance-1204:~# route add -net default gw 10.10.10.1
root@myinstance-1204:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.10.10.1
search incus
root@myinstance-1204:~# host www.google.com
www.google.com has address 172.217.20.68
www.google.com has IPv6 address 2a00:1450:4017:812::2004
root@myinstance-1204:~#