Lxc container with no ip address

i am using ubuntu 18.04 LTS in virtualbox. i have a problem with lxc container, as i search a lot but got no help.
when i use the command sudo lxc-ls --fancy
it gives me output
controller STOPPED 0 - - - false
default_switch STOPPED 0 - - - false
pgw STOPPED 0 - - - false
ran STOPPED 0 - - - false
sgw STOPPED 0 - - - false
sink STOPPED 0 - - - false

etc/network/interfaces of the container is also empty

i assigned the ip address to the above config files. i have created 3 extra Ethernet connection eth1 eth2 eth3. i am using linux ubuntu through virtualbox.
kindly help me to solve this issue

I know this answer comes pretty late, but I experienced a similar issue today. LXC host runs Ubuntu 18.04, container runs Ubuntu 18.04, too. I noticed that my container doesn’t have an IP address showing up in lxc-ls -f, even though it is correctly configured in the container’s config file.

It turned out to be a problem of netplan. Even though netplan inside the container was configured to not do anything and not use dhcp, this somehow disabled the network interface from getting the IP address.

Once I removed netplan.io in the container, the LXC container got its ip address from the container config and all was fine again.

1 Like