問(wèn)題
VirtualBox 運(yùn)行正常,但建立虛擬機(jī)打開(kāi)虛擬機(jī)報(bào)錯(cuò)如下:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing
'/sbin/vboxconfig'
as root.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
原因
出現(xiàn)此原因是因?yàn)橄到y(tǒng)內(nèi)核與VirtualBox要求的不一致,需安裝對(duì)應(yīng)版本的Linux-headers
解決方法
一般來(lái)說(shuō),軟件出現(xiàn)錯(cuò)誤都會(huì)有錯(cuò)誤碼,錯(cuò)誤提示和解決方法。
上面錯(cuò)誤提示是要用戶使用root權(quán)限執(zhí)行命令/sbin/vboxconfig來(lái)重新安裝內(nèi)核模塊,按提示操作來(lái)嘗試解決
$ sudo /sbin/vboxconfig
如果只出現(xiàn)下面的提示信息,說(shuō)明問(wèn)題已經(jīng)解決,重新運(yùn)行虛擬機(jī)檢驗(yàn)一下是否成功。
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
如果出現(xiàn)下面的提示信息,說(shuō)明問(wèn)題還沒(méi)有解決
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 Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
提示用戶安裝當(dāng)前內(nèi)核的header,然后再次運(yùn)行sudo /sbin/vboxconfig
$ sudo yum install kernel-devel
$ sudo yum install kernel-headers
$ sudo /sbin/sbin/vboxcofig
最后出現(xiàn)結(jié)果如下,問(wèn)題已經(jīng)解決
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules
重啟VirtualBox