Fedora26下VirtualBox5.2启动虚拟机报内核错误

作者: wxfeng 分类: linux 发布时间: 2018-11-28 00:00    阅读 1,126 次

Fedora26 Workstation下安装VirtualBox5.2

安装方法:https://tecadmin.net/install-oracle-virtualbox-on-centos-redhat-and-fedora/

安装完毕,挂载winxp系统ISO,在启动时报错:


根据提示,在终端执行/sbin/vboxconfig,提示如下错误:提示相关头文件不匹配。

[root@192 ~]# sudo /sbin/vboxconfig
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /usr/lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /usr/lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /usr/lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /usr/lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: Stopping 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.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.11.8-300.fc26.x86_64
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.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.11.8-300.fc26.x86_64
There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.


查看当前kernel-devel的版本,与所需版本确实不一致

[root@192 ~]# rpm -q kernel-devel
kernel-devel-4.13.10-200.fc26.x86_64


解决方案:安装与内核版本对应的kernel-devel

[root@192 ~]# yum install "kernel-devel-uname-r == $(uname -r)"

再次查看kernel-devel的版本

[root@192 ~]# rpm -q kernel-devel
kernel-devel-4.13.10-200.fc26.x86_64
kernel-devel-4.11.8-300.fc26.x86_64

安装成功!

再次执行/sbin/vboxconfig,内核模块绑定成功。

[root@192 ~]# sudo /sbin/vboxconfig
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /usr/lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /usr/lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /usr/lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /usr/lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.


点击启动按钮,成功进入系统安装界面

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。