kevingoos
kevingoos

Reputation: 4313

Proxmox lxc add add linux.kernel_modules

I am trying to setup an LXC container (debian) as a Kubernetes node. I am so far that the only thing in the way is the kubeadm init script...

error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR SystemVerification]: failed to parse kernel config: unable to load kernel module: "configs", output: "modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.44-2-pve/modules.dep.bin'\nmodprobe: FATAL: Module configs not found in directory /lib/modules/5.4.44-2-pve\n", err: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

After some research I figured out that I probably need to add the following: linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay But adding this to /etc/pve/lxc/107.conf doesn't do anything.

Does anybody have a clue how to add the linux kernel modules?

Upvotes: 1

Views: 8879

Answers (3)

qRoC
qRoC

Reputation: 178

For the fix ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file run from the host:

pct set $VMID --mp0 /usr/lib/modules/$(uname -r),mp=/lib/modules/$(uname -r),ro=1,backup=0

For the fix [ERROR SystemVerification]: failed to parse kernel config run from the host:

pct push $VMID /boot/config-$(uname -r) /boot/config-$(uname -r)

Where $VMID is your container id.

Upvotes: 1

Ruslan Ryngach
Ruslan Ryngach

Reputation: 21

To allow load with modprobe any modules inside privileged proxmox lxc container, you need add this options to container config:

lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.mount.auto: proc:rw sys:rw
lxc.mount.entry: /lib/modules lib/modules none bind 0 0

before that, you must first create the /lib/modules folder inside the container

Upvotes: 2

Rico
Rico

Reputation: 61621

I'm not sure what guide you are following but assuming that you have the required kernel modules on the host, this would do it:

lxc config set my-container linux.kernel_modules overlay

You can follow this guide from K3s too. Basically:

lxc config edit k3s-lxc

and

config:
  linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
  raw.lxc: lxc.mount.auto=proc:rw sys:rw
  security.privileged: "true"
  security.nesting: "true"

✌️

Upvotes: 1

Related Questions