[lxc-users] How to enable SElinux for LXC ?

bryn1u85 . m.bryn1u at gmail.com
Thu Feb 8 12:26:20 UTC 2018


Hey,
Im trying to run lxc with selinux on Centos 7. I installed and created lxc
container with simple command lxc-create -n test -t centos. After that i
just added to the:
/var/lib/lxc/test/config
line like below:
lxc.selinux.context = system_u:system_r:lxc_t:s0:c22
or entry from  https://stgraber.org/2014/01/01/lxc-1-0-security-features/ :
lxc.se_context = unconfined_u:unconfined_r:lxc_t:s0-s0:c0.c1023

Doesn’t matter which, issue is the same.
When i want to run it, im getting error:

[root at Centos test]# lxc-start -n test
lxc-start: confile.c: parse_line: 1750 unknown key lxc.selinux.context
lxc-start: parse.c: lxc_file_for_each_line: 57 Failed to parse config:
lxc.selinux.context = system_u:system_r:lxc_t:s0:c22

lxc-start: lxc_start.c: main: 268 Failed to create lxc_container

I have sent mail to the mailing list, written on github, forums, asked on
freenode but i haven’t got any answer. There isn’t any good article or
manual to help me fix it. Someone can help me resolve this problem ?  Or
know some other way implement selinux for lxc ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180208/1ef16ea4/attachment.html>


More information about the lxc-users mailing list