Containers don't get an ipv4 address

# snap install lxd
lxd 5.2-79c3c3b from Canonical✓ installed

# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: dir
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]: no
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

# lxc launch images:ubuntu/jammy test
Creating test
Starting test

# lxc list
+------+---------+------+------+-----------+-----------+
| NAME |  STATE  | IPV4 | IPV6 |   TYPE    | SNAPSHOTS |
+------+---------+------+------+-----------+-----------+
| test | RUNNING |      |      | CONTAINER | 0         |
+------+---------+------+------+-----------+-----------+

# lsof -i :domain
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 112952  lxd    6u  IPv4 916574      0t0  UDP 10.212.195.1:domain
dnsmasq 112952  lxd    7u  IPv4 916575      0t0  TCP 10.212.195.1:domain (LISTEN)

Ubuntu 22.04.

help?

This smells like some kind of firewall interaction. This can happen on systems running Docker, or with UFW enabled or with firewalld enabled. We have some pointers about this here How to configure your firewall - LXD documentation

Amazing observation!
I followed these instructions, and got an ip :slight_smile:

+------+---------+-----------------------+------+-----------+-----------+
| NAME |  STATE  |         IPV4          | IPV6 |   TYPE    | SNAPSHOTS |
+------+---------+-----------------------+------+-----------+-----------+
| test | RUNNING | 10.212.195.210 (eth0) |      | CONTAINER | 0         |
+------+---------+-----------------------+------+-----------+-----------+

Thank you so much! I’ve been struggling with this the whole week :confused: