surroundings
- Host: CentOS 7, x86-64 bits
- LXC: LXC-2.1.1,make && make install
Create lxc-sshd container
lxc-create -t sshd -n sshd-1 -- --auth-key ./lxc.pub
Run the container
lxc-start -n sshd-1
Report the following error
lxc-start: sshd-1: conf.c: setup_caps: 2260 unknown capability sys_module ...
Solution
参考 LXC start error : setup_caps: 2337 unknown capability mac_admin
Install libcap-dev using
apt-get install libcap-dev
Then, recompile the LXC.
Install libcap-devel.x86_64 in CentOS 7, then recompile LXC 2.1.1, recreate sshd-1, the problem is solved.