Tuesday, October 3, 2017

How do I install a kernel module in an LXC guest machine?



I am attempting to install OpenStack DevStack on an LXC guest machine. One of DevStack's packages requires a new kernel module, but when I try to run modprobe on the LXC guest I get an error:



ubuntu@lxc$ sudo modprobe scsi_transport_iscsi
FATAL: Could not load /lib/modules/3.2.0-48-generic/modules.dep: No such file or directory


How can I install this module for my LXC guest machine?




Short answer is, you can't. LXC containers share their kernel with the host's and by default aren't allowed to load modules (as this would be pretty dangerous).



The standard recommendation is to have any module loaded on the host prior to starting the container. You can either do that with a good old init script or by using an lxc hook (see my recent post here for details: https://www.stgraber.org/2013/12/23/lxc-1-0-some-more-advanced-container-usage/)


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...