我使用 Windows 7 作为主机,并使用 Ubuntu 12.10 Remix(纯 Gnome 的 Ubuntu)作为客户机。
一切正常。我以常规方式安装了 VBoxAdditions - 使用 VirtualBox VM 管理器中的相应命令,然后VBoxLinuxAdditions.run
从已安装的驱动器运行脚本。安装过程似乎也正常。
但是,/var/log/vboxadd-install.log
我看到了以下内容:
Uninstalling modules from DKMS
Attempting to install using DKMS
Creating symlink /var/lib/dkms/vboxguest/4.2.6/source ->
/usr/src/vboxguest-4.2.6
DKMS: add completed.
Error! Your kernel headers for kernel 3.5.0-17-generic cannot be found.
Please install the linux-headers-3.5.0-17-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Failed to install using DKMS, attempting to install without
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
然后我按照说明尝试安装linux-headers-3.5.0-17-generic
,并得到这个(日志中的最后两行apt-get
):
Error! Problems with depmod detected. Automatically uninstalling this module.
DKMS: Install Failed (depmod problems). Module rolled back to built state.
答案1
请安装 linux-headers-3.5.0-17-generic 包。
由于 virtualbox 针对当前内核编译其模块,因此它至少需要该内核的 C 头文件。