Docker Community Forums

Share and learn in the Docker community.

KVM module is not loaded in container

docker

(Lior1712) #1

I am running a Linux container on my windows laptop. Container is running CentOS 7.4.1708. Laptop is running Windows 10 Enterprise version 1709 build 16299

The problem: I can not load KVM module inside the container. modprobe command is failing without any message and there is nothing in dmesg. I looked in Linuxkit kernel config files, kvm is there with the loadable module option (m).

I enabled virtualization in the laptop bios and also enabled nested virtualization in the MobyLinuxVM in Hyper-V (I used the below manual)

I am using the following command to run the container:

docker run -d --net=host --cap-add=SYS_ADMIN -h lior_docker --privileged --security-opt seccomp:unconfined -v /sys/fs/cgroup:/sys/fs/cgroup:ro -it dc627b1ec862 /usr/sbin/init

docker exec -it 9f3ee1f223a7 /bin/bash

What am I missing?


(David Maze) #2

Loading kernel modules from inside Docker containers is generally impossible. If your application depends on having a very specific kernel module available, it might be better run inside a virtual machine.