我最近安装了 Centos 8 的全新副本,并尝试安装 VirtualBox-6.0 并遇到以下问题:
WARNING: The `vboxdrv` kernel module is not loaded. Either there is no module
available for the current kernel (4.18.0-80.el8.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.
我在网上阅读了其他遇到此问题的人并运行了下一个命令:
sudo /sbin/rcvbodrv 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-4.18.0-80.el8.x86_64
既然如此,我下载了gcc
make
perl
,kernel-devel
等等......
之后我重新运行之前的/sbin
命令并得到以下结果:
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.
在日志中我看到这个......
$ cat /var/log/vbox-setup.log
Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.18.0-80.el8.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
Makefile:958: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel".
Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:111: vboxdrv] Error 2
现在我很茫然,因为我在任何地方都找不到任何线索......
更新:2019年9月30日
@jsbillings 注意到安装该软件包是显而易见的elfutils-libelf-devel
。那是一个深夜,完全错过了阅读那篇文章。我安装了以下内容并使用以下命令重建了内核模块:
sudo /sbin/rcvbodrv setup
然后我在终端中重新运行 VirtualBox 命令,它的效果非常好!