我正在尝试安装旧版本的 virtualbox (4.3.0),因为我将在一个使用它的项目中工作。
安装 VirtualBox 后,当我写入时出现此错误virtualbox --version
:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.8.0-36-generic) or it failed to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "S&tart" under id 16
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Pause" under id 17
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "&Reset" under id 18
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "D&iscard saved state..." under id 24
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "Re&fresh..." under id 25
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "Show in File Manager" under id 27
Qt WARNING: void DBusMenuExporterPrivate::addAction(QAction*, int): Already tracking action "Create Shortcut on Desktop" under id 28
如果我按照警告提示运行此代码:
sudo /etc/init.d/vboxdrv setup
我遇到了其他错误:
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-4.3.0.crash'
Error! Bad return status for module build on kernel: 4.8.0-36-generic (x86_64)
Consult /var/lib/dkms/vboxhost/4.3.40/build/make.log for more information.
...failed!
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
(Look at /var/log/vbox-install.log to find out what went wrong)
我尝试通过以下其他 askubuntu 问题解决我的问题,但没有成功:
如何修复 VirtualBox 中的 vboxdrv 设置失败?
安装新的 Linux 内核 4.4 后 Virtualbox 出现错误
我需要这个 VB 版本,因为我正在使用 vagrant 1.7.2,运行时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.
所以,我无法在 ubuntu 16 中启动 virtualbox。
编辑:我添加了来自以下位置的日志/var/lib/dkms/vboxhost/4.3.40/build/make.log
:
DKMS make.log for vboxhost-4.3.40 for kernel 4.8.0-36-generic (x86_64)
dom mar 5 09:44:42 VET 2017
make: Entering directory '/usr/src/linux-headers-4.8.0-36-generic'
LD /var/lib/dkms/vboxhost/4.3.40/build/built-in.o
LD /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/linux/SUPDrv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/SUPDrv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/SUPDrvSem.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/SUPDrvTracer.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/alloc-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/initterm-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/memobj-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/mpnotification-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/powernotification-r0drv.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/process-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/semmutex-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/spinlock-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/thread-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/thread2-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/time-r0drv-linux.o
CC [M] /var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o
/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c: In function ‘rtTimerLnxStartSubTimer’:
/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/timer-r0drv-linux.c:364:13: error: implicit declaration of function ‘mod_timer_pinned’ [-Werror=implicit-function-declaration]
mod_timer_pinned(&pSubTimer->u.Std.LnxTimer, pSubTimer->u.Std.ulNextJiffies);
^
cc1: some warnings being treated as errors
scripts/Makefile.build:289: recipe for target '/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o' failed
make[2]: *** [/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o] Error 1
scripts/Makefile.build:440: recipe for target '/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv' failed
make[1]: *** [/var/lib/dkms/vboxhost/4.3.40/build/vboxdrv] Error 2
Makefile:1491: recipe for target '_module_/var/lib/dkms/vboxhost/4.3.40/build' failed
make: *** [_module_/var/lib/dkms/vboxhost/4.3.40/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.8.0-36-generic'
答案1
我建议您使用此处提供的当前稳定版本的 Virtualbox:https://www.virtualbox.org/wiki/Downloads
Virtualbox 可以导入和导出由其他版本的 Virtualbox 创建的任何 OVF/OVA 文件。
导入详细信息: https://www.virtualbox.org/manual/ch08.html#vboxmanage-import
出口细节: https://www.virtualbox.org/manual/ch08.html#vboxmanage-export
答案2
最后我终于解决了这个问题,但是这个解决方案对我来说不是 100% 正确,不过让我可以重新开始工作。
首先,ubuntu 的最新版本与 Virtualbox < 5.0 不兼容,某些版本发布后,旧版本将被弃用,所以这对我来说是个大问题,因为 Vagrant 1.7.2 不适用于 > 5.0。更新 Vagrant 对我来说不是一个选择,因为整个设置都是为与 Vagrant 1.7.2 配合使用的。
在我测试了很多不同的方法来修复这个错误之后,发现“几乎不可能”,我唯一能做的就是安装一个较旧的 ubuntu 版本 (14.04),该版本具有导致所有这个问题的正确内核版本,并让 Virtualbox 正常工作。所以我安装了 ubuntu 14.04。运行后,vagrant up
一切都按预期运行。