LXD Windows VM not showing IPV4 address under lxc list

I have been experimenting with Windows VMs, and have succesfuly created a working Windows Server 19 instance. However, I noticed that after restarting the container the IPV4 information was gone even though the instance has internet connectivity with a LAN IP address. Though it is possible to fetch it through RDP access I needed the information displayed under lxc list for automation purposes.

Is there anyway to fetch this information through LXD?

To clarify both the IPV4 and IPV6 information were displayed under lxc list when I first created wserver19. They only stopped appearing after a restart.

Can you show lxc network list?

I am using br0 for the VMs.

It appears that after some time the IP address appeared.

However the win10 VM remains the same. This VM was created using the exported image of wserver19.

EDIT: Apparently they both work now…

I am still puzzled as to what made it so that the addresses were not shown.

For Linux VMs and containers we can reliably pull the address from within the instance.
For the others (like Windows) all we can do is parse DHCP lease files and hope that we have a matching record in there.

This latter mode only reliably works on LXD managed bridges (like your lxdbr0).

In recent LXD releases we also look at the ARP and NDP neighbour cache on the host’s bridge interface for IPs associated with the VM’s interface’s MAC address.

This means that even if you’re not using a managed LXD bridge with DHCP, if there has been some activity between the VM guest and the host (or the wider network), LXD should be able to display the IP information.

That does indeed work!

Now I just have to figure out a way to have any communication between newly created VMs and host automaticaly. Thank you.