我尝试以特权模式运行容器,但仍然无法加载vboxdrv.
我明白了
WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.11.0-22-generic) or it failed to load. Please recompile the kernel module and install it by sudo /etc/init.d/vboxdrv setup You will not be able to start VMs until this problem is fixed.
小智.. 12
是的你可以.您需要确保在主机系统上安装了内核模块.我正在运行Ubuntu,但我确信它在其他发行版上也是类似的:
sudo apt-get install linux-headers-generic virtualbox-dkms
并确保加载内核模块:
sudo /etc/init.d/virtualbox status VirtualBox kernel modules are loaded.
现在,运行docker容器,并将/ dev/vboxdrv挂载为卷:
docker run -it -v /dev/vboxdrv:/dev/vboxdrv your/container-image
WOW.. 11
编辑在 2016-03-27 12:54 UTC
我有完全相同的问题,我可以使用CentOS 7上的Extension Pack和phpvirtualbox成功地将最新版本的VirtualBox停靠.
你必须安装大量的依赖项,如kernel-devel,make,gcc和dkms.完成docker build之后,必须使用这些标志运行docker镜像您需要--privileged=true -v /dev/:/dev/
.--privileged=true
使用docker版本1.10.3运行映像的标志
有关详细信息,请参阅我的Dockerfile
和run.sh
有关详情,请看看我的仓库尤其是Makefile
,virtualbox.Dockerfile
,vboxwebsrv.Dockerfile
和phpvirtualbox.Dockerfile