在安装流浪汉时,错过yum包的centos 7

时间:2014-09-01 18:35:15

标签: centos vagrant virtualbox centos7

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

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> 

缺少什么包裹?

2 个答案:

答案 0 :(得分:4)

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

sudo yum install gcc kernel-devel

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

sudo /etc/init.d/vboxdrv setup

您现在可以运行:

vagrant up

答案 1 :(得分:1)

第2步对我不起作用:

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

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

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

希望它有所帮助;)