Im very much new to LXC and LXD concepts. I was experimenting with LXC's by creating a containers and destroying them.
after some experiments, I tried to create a container to implement by task, was successful in creating a container but was not able to start it. getting below error.
I have tried uninstalling and installing lxc and lxd.
I tried purge lxc and lxd, but no luck.
I have gone through some forms but was not able to solve my issue.
Please let me know what is wrong here.
I know that Im unable to remove the destroyed containers completely, not sure how to remove them.
When running sudo lxc-start -n vims
getting below error:
lxc-start: lxccontainer.c: wait_on_daemonized_start: 804 Received container state "STOPPING" instead of "RUNNING"
The container failed to start.
To get more details, run the container in foreground mode.
Additional information can be obtained by setting the --logfile and --logpriority options.
When ran with logfile sudo lxc-start -n vims --logfile errorlog.txt
the output of the log file is as below:
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:create_path_for_hierarchy:1720 - The cgroup "/sys/fs/cgroup/systemd//lxc/vims" already existed
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:cgfsng_create:1804 - Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/vims"
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:create_path_for_hierarchy:1720 - The cgroup "/sys/fs/cgroup/systemd//lxc/vims-1" already existed
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:cgfsng_create:1804 - Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/vims-1"
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:create_path_for_hierarchy:1720 - The cgroup "/sys/fs/cgroup/systemd//lxc/vims-2" already existed
lxc-start 20210607162943.382 ERROR lxc_cgfsng - cgroups/cgfsng.c:cgfsng_create:1804 - Failed to create cgroup "/sys/fs/cgroup/systemd//lxc/vims-2"
lxc-start 20210607162943.476 ERROR lxc_start - start.c:start:1891 - Exec format error - Failed to exec "/sbin/init"
lxc-start 20210607162943.476 ERROR lxc_sync - sync.c:__sync_wait:59 - An error occurred in another process (expected sequence number 7)
lxc-start 20210607162943.476 ERROR lxc_start - start.c:__lxc_start:1802 - Failed to spawn container "vims".
lxc-start 20210607162943.476 ERROR lxc_container - lxccontainer.c:wait_on_daemonized_start:804 - Received container state "STOPPING" instead of "RUNNING"
As mentioned in the errorlog, if we check /sys/fs/cgroup/systemd/lxc
directory, the contents are as below
drwxr-xr-x 2 root root 0 Jun 7 16:32 container_2
drwxr-xr-x 2 root root 0 Jun 7 16:33 container_2-1
drwxr-xr-x 2 root root 0 Jun 7 16:33 container_2-2
-rw-r--r-- 1 root root 0 Jun 7 16:34 tasks
-rw-r--r-- 1 root root 0 Jun 7 16:34 notify_on_release
-rw-r--r-- 1 root root 0 Jun 7 16:34 cgroup.procs
-rw-r--r-- 1 root root 0 Jun 7 16:34 cgroup.clone_children
drwxr-xr-x 2 root root 0 Jun 7 17:03 container_2-3
drwxr-xr-x 2 root root 0 Jun 7 17:03 container_2-4
drwxr-xr-x 2 root root 0 Jun 7 17:07 vims
drwxr-xr-x 2 root root 0 Jun 7 17:08 vims-1
drwxr-xr-x 2 root root 0 Jun 7 21:57 vims-2
drwxr-xr-x 2 root root 0 Jun 7 21:59 vims-3
drwxr-xr-x 2 root root 0 Jun 7 22:04 POC
I tried to delete the above container directories but the linux was not allowing me to do so.
Background of the issue, I have created multiple containers and destroyed them by sudo lxc-destroy -n <container_name>
Thanks in advance!!!