ubuntu装virtualbox出现/etc/init.d/vboxdrv setup'问题

[root@localhost ~]#/etc/init.d/vboxdrv setup              
Stopping VirtualBox kernel module                          [确定]
Recompiling VirtualBox kernel module                       [失败]
(Look at /var/log/vbox-install.log to find out what went wrong)

打开/var/log/vbox-install.log 内容如下:
Makefile:147: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 停止。

解决办法:
安装gcc和 kernel-devel
su
yum install gcc
yum install
kernel-devel

以管理员运行/ etc/init.d/vboxdrv setup即可解决

[root@localhost ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module                          [确定]
Recompiling VirtualBox kernel module                       [确定]
Starting VirtualBox kernel module                          [确定]

你可能感兴趣的:(linux,ubuntu,Module,gcc,makefile)