![VirtualBox:在 Ubuntu 12.10 上安装 Guest Additions 作为客户操作系统](https://linux22.com/image/1352902/VirtualBox%EF%BC%9A%E5%9C%A8%20Ubuntu%2012.10%20%E4%B8%8A%E5%AE%89%E8%A3%85%20Guest%20Additions%20%E4%BD%9C%E4%B8%BA%E5%AE%A2%E6%88%B7%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F.png)
我使用 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 头文件。