LXD Container not getting ip address from DHCP using linux bridge

i did a fresh install of lxd on a new system. ubuntu 18.04 host. i have an older host with same os and has been running lxd for a few years - no issue.

new system can’t get an ip address from local dhcp server.

i’ve set up a linux bridge on the host called br0.

default template:
config: {}
description: “”
name: eth0
nictype: bridged
parent: br0
type: nic
path: /
pool: lxd
type: disk
name: default

  • /1.0/containers/u18

u18 container:
architecture: x86_64
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20191205)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: “20191205”
image.type: squashfs
image.version: “18.04”
volatile.base_image: f75468c572cc50eca7f76391182e6fdaf58431f84c3d35a2c92e83814e701698
volatile.eth0.host_name: veth988ba8a6
volatile.eth0.hwaddr: 00:16:3e:f8:eb:91
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: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.power: RUNNING
name: eth0
nictype: bridged
parent: br0
type: nic
path: /
pool: lxd
type: disk
ephemeral: false

  • default
    stateful: false
    description: “”

but it won’t get an ip addres…

the same bridge, br0, is used successfully with kvm and the VMs get IP addresses.

been banging my head for hours trying to figure this out…

compared containers from my other working system and they look the same to me. the only real differences in the machines besides newer hardware are:

  • older machine is running 4.15 kernel, newer machine is running 5.0 kernel:
    Linux jay-desktop 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

and newer maching is also running UEFI vs legacy bios

what else could help trace the problem here?

I noticed this same behavior today as well. Older host ok on 5.1.7-1 vs newer host issue on 5.3.12-1. Note that the newer host is not a new install, just more recent kernel.

DHCP server log shows nothing.

so that seems very odd. your older host on a 5.1 kernel is working - mine on a 5.0 kernel is not.

i installed a 4.15 kernel & now i get an IP address just fine.

prior to downgrading the kernel, i played around thinking it may have been related to networkmanager on ubuntu - switched netplan to using networkd instead of NetworkManager… and set up the bridge manually. no change.

my next step was going to try openvswitch instead of linux bridge… but i haven’t used it before so didn’t want to deal with that today.

seems to me somethigng is going on related to the combination of the newer kernel and lxd… i still have a 5.0 kernel on another ssd drive in this machine i can switch back to if there’s something i can try to make this work on the newer kernel…

I will have some time to test again in a few days. Meantime might look at any backported kernel updates.

Do you ever find out how to make it work ?

I’m on a fresh Ubuntu 18.04 install, lxd 4.01 init with most defaults, Ubuntu 18.04 container.

No ipv4.

i continued to have problems with it and gave up on it - i started using openvswitch instead and the problem went away.

Pretty sure it came down to the systemd version. I forget what the problem number was, but once my Tumbleweed version moved past it, I was back in business with ipv4.

Thanks for your quick reply although I’m not that hopeful now :wink:

Edit: Ok so I re-installed the OS and lxd and now it works.

I think the only thing I did differently is installing bridge-utils beforehand, and setting ipv6 to ‘none’ during “lxd init”, not sure which one helped (I would guess the latter).

Edit2: while it worked it is randomly not working after a reboot. Also I have a dns problem inside the container once I make systemd works with the .lxd domain.

Sadly this is not the LXD experience I expected from my previous test :frowning: