Not an answer per-se, but some information for comparison.
I’ve spun up a 12.04
container on lxd 6.1-c14927a
to attempt to reproduce to problem: my container does acquire an IPv4 address.
$ lxc launch ubuntu:12.04
Creating the instance
Instance name is: calm-mullet
Starting calm-mullet
$ lxc list status=running name=calm-mullet
+-------------+---------+---------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------------+---------+---------------------+-----------------------------------------------+-----------+-----------+
| calm-mullet | RUNNING | 10.241.25.24 (eth0) | fd42:1e62:7326:f1e1:216:3eff:fecc:8ef0 (eth0) | CONTAINER | 0 |
+-------------+---------+---------------------+-----------------------------------------------+-----------+-----------+
$ lxc list status=running name=calm-mullet --format=yaml
- name: calm-mullet
description: ""
status: Running
status_code: 103
created_at: 2024-08-23T10:15:35.368738839Z
last_used_at: 2024-08-23T10:16:05.529511589Z
location: none
type: container
project: default
architecture: x86_64
ephemeral: false
stateful: false
profiles:
- default
config:
image.architecture: amd64
image.description: ubuntu 12.04 LTS amd64 (release) (20170502)
image.label: release
image.os: ubuntu
image.release: precise
image.serial: "20170502"
image.type: root.tar.xz
image.version: "12.04"
volatile.base_image: be4aa8e56eab681fac6553b48ce19d7f34833accc2c8ae65f140a603b8369a1d
volatile.cloud-init.instance-id: f1382616-2337-45c2-9b36-9a21c9d506ce
volatile.eth0.host_name: veth7ec38b1e
volatile.eth0.hwaddr: 00:16:3e:cc:8e:f0
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[]'
volatile.last_state.power: RUNNING
volatile.uuid: 9803ac3d-1839-480b-870e-ae2500b1b1f4
volatile.uuid.generation: 9803ac3d-1839-480b-870e-ae2500b1b1f4
devices: {}
expanded_config:
image.architecture: amd64
image.description: ubuntu 12.04 LTS amd64 (release) (20170502)
image.label: release
image.os: ubuntu
image.release: precise
image.serial: "20170502"
image.type: root.tar.xz
image.version: "12.04"
volatile.base_image: be4aa8e56eab681fac6553b48ce19d7f34833accc2c8ae65f140a603b8369a1d
volatile.cloud-init.instance-id: f1382616-2337-45c2-9b36-9a21c9d506ce
volatile.eth0.host_name: veth7ec38b1e
volatile.eth0.hwaddr: 00:16:3e:cc:8e:f0
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[]'
volatile.last_state.power: RUNNING
volatile.uuid: 9803ac3d-1839-480b-870e-ae2500b1b1f4
volatile.uuid.generation: 9803ac3d-1839-480b-870e-ae2500b1b1f4
expanded_devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
backups: []
state:
status: Running
status_code: 103
disk: {}
memory:
usage: 10493952
usage_peak: 0
total: 7860656000
swap_usage: 81920
swap_usage_peak: 0
network:
eth0:
addresses:
- family: inet
address: 10.241.25.24
netmask: "24"
scope: global
- family: inet6
address: fd42:1e62:7326:f1e1:216:3eff:fecc:8ef0
netmask: "64"
scope: global
- family: inet6
address: fe80::216:3eff:fecc:8ef0
netmask: "64"
scope: link
counters:
bytes_received: 23370
bytes_sent: 5694
packets_received: 263
packets_sent: 58
errors_received: 0
errors_sent: 0
packets_dropped_outbound: 0
packets_dropped_inbound: 0
hwaddr: 00:16:3e:cc:8e:f0
host_name: veth7ec38b1e
mtu: 1500
state: up
type: broadcast
lo:
addresses:
- family: inet
address: 127.0.0.1
netmask: "8"
scope: local
- family: inet6
address: ::1
netmask: "128"
scope: local
counters:
bytes_received: 0
bytes_sent: 0
packets_received: 0
packets_sent: 0
errors_received: 0
errors_sent: 0
packets_dropped_outbound: 0
packets_dropped_inbound: 0
hwaddr: ""
host_name: ""
mtu: 65536
state: up
type: loopback
pid: 610868
processes: 15
cpu:
usage: 14451731000
snapshots: []
There has been the rare occasion where a Jammy container, which is the version I predominantly use, has failed to acquire an IPv4 address. I’ve not attempted to track down the reason thus far.