升级到最新版本的 Virtual Box 后,启动虚拟机时显示以下消息
运行 /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! Your kernel headers for kernel 3.8.0-31-generic cannot be found.
Please install the linux-headers-3.8.0-31-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
...failed!
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
(Look at /var/log/vbox-install.log to find out what went wrong)
/var/log/vbox-install.log
Uninstalling modules from DKMS
removing old DKMS module vboxhost version 4.3.4
------------------------------
Deleting module version: 4.3.4
completely from the DKMS tree.
------------------------------
Done.
Attempting to install using DKMS
Creating symlink /var/lib/dkms/vboxhost/4.3.4/source ->
/usr/src/vboxhost-4.3.4
DKMS: add completed.
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
运行 sudo apt-get install linux-headers-3.8.0-31-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers-3.8.0-31-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linux-headers-3.8.0-31-generic' has no installation candidate
任何帮助都将不胜感激!
答案1
通过在以下网址下载最新版本的 Virtual Box 来解决https://www.virtualbox.org/wiki/Linux_Downloads