docker-lxc icon indicating copy to clipboard operation
docker-lxc copied to clipboard

Executing lxc-checkconfig failed and the lxc container could not be started

Open smywhut opened this issue 2 years ago • 0 comments

Hello. When I execute the lxc-checkconfig command in this docker container, I get an error:

LXC version 5.0.3
Kernel configuration not found at /proc/config.gz; searching...
lxc-checkconfig: unable to retrieve kernel configuration

Try recompiling with IKCONFIG_PROC, installing the kernel headers,
or specifying the kernel configuration path with:
  CONFIG=<path> lxc-checkconfig

When I try to execute lxc-start to start an lxc container, I encounter another error:

lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/cgroups/cgfsng.c: __cgfsng_delegate_controllers:  3341 Device or resource busy - Could not enable "+cpuset +cpu +io +memory +hugetlb +pids +rdma +misc" controllers in the  unified cgroup 7
lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/cgroups/cgfsng.c: __cgfsng_delegate_controllers:  3341 Device or resource busy - Could not enable "+cpuset +cpu +io +memory +hugetlb +pids +rdma +misc" controllers in the  unified cgroup 7
lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/sync.c: sync_wait: 34 An error occurred in another process (expected sequence number 4)
lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/start.c: __lxc_start: 2107 Failed to spawn container "autopkgtest-unstable-amd64"
lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/tools/lxc_start.c: main: 306 The container failed to start
lxc-start: autopkgtest-unstable-amd64: .. /src/lxc/tools/lxc_start.c: main:  311 Additional information can be obtained by setting the --logfile and --logpriority options

Here's how I use the docker run command:

docker run -it \
  --name lxc \
  --privileged  \
  --restart always \
  --memory 500M \
  --cpus 2 \
  -p 2222:22 \
  --hostname lxctest1 \
  -v /data:/data \
  -e DISTRIBUTION=alpine \
  -e INITIAL_SSH_KEY="ssh-rsa ***************" \
  5aef67a2ecfd /bin/bash

where 5aef67a2ecfd is the docker Image ID named micwy/lxc.

I think the configuration of my docker startup is incorrect. Could you please help me solve this problem?

smywhut avatar Nov 02 '23 03:11 smywhut