问题
VirtualBox 运行正常,但建立虚拟机打开虚拟机报错如下:
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.
原因
出现此原因是因为系统内核与VirtualBox要求的不一致,需安装对应版本的Linux-headers
解决方法
一般来说,软件出现错误都会有错误码,错误提示和解决方法。
上面错误提示是要用户使用root
权限执行命令/sbin/vboxconfig
来重新安装内核模块,按提示操作来尝试解决
$ sudo /sbin/vboxconfig
如果只出现下面的提示信息,说明问题已经解决,重新运行虚拟机检验一下是否成功。
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
如果出现下面的提示信息,说明问题还没有解决
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.
提示用户安装当前内核的header
,然后再次运行sudo /sbin/vboxconfig
$ sudo yum install kernel-devel
$ sudo yum install kernel-headers
$ sudo /sbin/sbin/vboxcofig
最后出现结果如下,问题已经解决
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules
重启VirtualBox
网友评论