How to get IP address for centos7 container

The host is Ubuntu 22 (jammy).
Two Ubuntu containers running - with an IP 10.x.x.x
One centos7 container is running but has no IP address.
How do I get an IP address for the centos7?
Thank you

edit:
here’s the output of lxc-start -o centos7log.txt -l 2 -n centos7

lxc-start centos7 20220923145856.882 ERROR    cgfsng - cgroups/cgfsng.c:__cgfsng_delegate_controllers:2953 - Device or resource busy - Could not enable "+memory +pids" controllers in the unified cgroup 11
lxc-start centos7 20220923145856.899 ERROR    cgfsng - cgroups/cgfsng.c:__cgfsng_delegate_controllers:2953 - Device or resource busy - Could not enable "+memory +pids" controllers in the unified cgroup 11
lxc-start centos7 20220923145856.919 ERROR    network - network.c:lxc_create_network_unpriv_exec:2990 - lxc-user-nic failed to configure requested network: cmd/lxc_user_nic.c: 1206: main: Quota reached
lxc-start centos7 20220923145856.919 ERROR    start - start.c:lxc_spawn:1843 - Failed to create the network
lxc-start centos7 20220923145856.919 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:877 - Received container state "ABORTING" instead of "RUNNING"
lxc-start centos7 20220923145856.919 ERROR    lxc_start - tools/lxc_start.c:main:306 - The container failed to start
lxc-start centos7 20220923145856.919 ERROR    lxc_start - tools/lxc_start.c:main:309 - To get more details, run the container in foreground mode
lxc-start centos7 20220923145856.919 ERROR    lxc_start - tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options
lxc-start centos7 20220923145856.919 ERROR    start - start.c:__lxc_start:2074 - Failed to spawn container "centos7"
lxc-start centos7 20220923150039.332 ERROR    network - network.c:lxc_create_network_unpriv_exec:2990 - lxc-user-nic failed to configure requested network: cmd/lxc_user_nic.c: 1206: main: Quota reached
lxc-start centos7 20220923150039.333 ERROR    start - start.c:lxc_spawn:1843 - Failed to create the network
lxc-start centos7 20220923150039.333 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:877 - Received container state "ABORTING" instead of "RUNNING"
lxc-start centos7 20220923150039.333 ERROR    lxc_start - tools/lxc_start.c:main:306 - The container failed to start
lxc-start centos7 20220923150039.333 ERROR    lxc_start - tools/lxc_start.c:main:309 - To get more details, run the container in foreground mode
lxc-start centos7 20220923150039.333 ERROR    lxc_start - tools/lxc_start.c:main:311 - Additional information can be obtained by setting the --logfile and --logpriority options
lxc-start centos7 20220923150039.334 ERROR    start - start.c:__lxc_start:2074 - Failed to spawn container "centos7"

Chances are your system is running in cgroup2 mode, that’s not supported by centos7 and prvents it from starting up. You will need to reboot your host into cgroup1 mode to fix this.

Thank you.
Can I please bother you with help on how to boot into cgroup1?

See Error: The image used by this instance requires a CGroupV1 host system when using clustering - #2 by tomp

1 Like

Thank you.
Just for clarity, this is the post with the solution which worked for me.

This link offers a solution which did not work for me.
So GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy=0" - did not work
GRUB_CMDLINE_LINUX_DEFAULT="systemd.unified_cgroup_hierarchy=false" did work

1 Like