A little quiestion about LXC on different kernels

We are using lxc(centos image) in our production systems on OL7/CentOS7 kernel 3.10. And it is ok. (Thank you :slight_smile:
Also, we started using Debian 9/10(Kernel 4.15/5.0), and we’ve transferred some containers to Debian from CentOS7. And it works fine on another kernel.

But I hope you can explain, how containers work on different kernels, for instance, 3.10 and 4.15?
Are there differences? What we have to expect in case of migration from 3.10 to another kernel?


In general, the Linux kernel has a strict policy to “not break user-space”. In that respect, if it works on an older kernel then it should be ok on a newer kernel.

Having said that, LXC needs some features in the kernel in order to work best. You might need a kernel that has those features enabled. To get an idea what’s going on with a kernel, you can run ‘lxc-checkconfig’, which checks your kernelconfig for module support. Have a look at the output of the command and report anything missing.

@simos Thank you for your answer!

Of course, I know about lxc-checkconfig,cgroups,namespaces and other useful things.

How do lxc guarantee that image centos7 will work properly on debian kernel? And vice-versa?
Host kernels are different. Features are different.