3

我刚刚安装了 centos 7,然后我尝试安装 vagrant。安装 virtualbox 之后,当我运行 vagrant up 时,我得到:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

我运行“VBoxManage --version”并出现错误

The vboxdrv kernel module is not loaded. Please recompile the kernel module and install it by sudo /etc/init.d/vboxdrv setup

我运行 sudo /etc/init.d/vboxdrv setup 我得到了

Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> 

缺少哪些包裹?

4

2 回答 2

4

您必须通过以下方式安装“gcc”和“kernel-devel”:

sudo yum install gcc kernel-devel

然后运行重新编译虚拟框:

sudo /etc/init.d/vboxdrv setup

你现在可以运行:

vagrant up
于 2014-09-01T18:35:15.013 回答
1

第 2 步对我不起作用:

sudo: /etc/init.d/vboxdrv: command not found

在另一个运行良好的线程上找到了这个:

sudo /usr/lib/virtualbox/vboxdrv.sh setup

希望它有所帮助;)

于 2017-07-28T13:37:47.957 回答