How to add kernel modules into an LXC container?

The LXC/LXD system containers do not load kernel modules for their own use.
What you do, is get the host it load the kernel module, and this module could be available in the container.
The overlay kernel module is available in system containers, if it is loaded (on the host).
You can setup your container to auto-load specific kernel modules when the container starts. This helps you so that you do not have to manually load kernel modules yourself.
I know how to do this with LXD,

 lxc config set mycontainer linux.kernel_modules overlay

But if you check the documentation link that you just gave, it also sets linux.kernel_modules to load specific modules.

6 Likes