我在啟動minikube時,遇到如下錯誤消息:

Starting local Kubernetes v1.10.0 cluster...
Starting VM...
E1010 03:27:37.920050 4827 start.go:174] Error starting host: Error creating host: Error executing step: Running precreate checks.
: We support Virtualbox starting with version 5. Your VirtualBox install is "WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.10.0-862.11.6.el7.x86_64) or it failed to load. Please recompile the kernel module and install it by sudo /sbin/vboxconfig You will not be able to start VMs until this problem is fixed. 5.2.18r124319". Please upgrade at
https://www.virtualbox.org.Retrying.
E1010 03:27:37.921090 4827 start.go:180] Error starting host: Error creating host: Error executing step: Running precreate checks.
https://www.virtualbox.org核心是這個錯:
The vboxdrv kernel module is not loaded.
執行指令行:
rcvboxdrv setup
結果:
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-3.10.0-862.11.6.el7.x86_64
解決方案:
1. 按照這篇文章的介紹安裝gcc make perl package:
[](
https://www.toutiao.com/i6610634214356288008/?group_id=6610634214356288008)2. 安裝kernel header檔案。參考:
https://www.toutiao.com/i6610639549208986125/?group_id=6610639549208986125)3. 執行指令行:
確定看到消息:
這個vboxdrv的作用,VirtualBox的幫助文檔寫的很清楚:
In order to run other operating systems in virtual machines alongside your main operating system, VirtualBox needs to integrate very tightly into the system. To do this it installs a "driver" module called vboxdrv which does a lot of that work into the system kernel, which is the part of the operating system which controls your processor and physical hardware. Without this kernel module, you can still use the VirtualBox manager to configure virtual machines, but they will not start.
我簡單翻譯一下:
為了在主控端裡以虛拟機的方式運作其他類型的作業系統,VirtualBox需要和主控端作業系統的Kernel互動,進行互動的子產品就稱為vboxdrv驅動,它本身也是作業系統的一部分,負責控制作業系統的CPU和其他硬體資源。如果沒有vboxdrv驅動,我們雖然仍舊可以使用VirtualBox manager來管理虛拟機,但無法在宿主系統上啟動這些虛拟機。
rcvboxdrv setup執行後問題解決。
要擷取更多Jerry的原創文章,請關注公衆号"汪子熙":