我正在尝试在VirtualBox 4.04中安装Guest Additions。主机操作系统是Ubuntu桌面11.04 64位,来宾操作系统是Ubuntu服务器11.10 64位。
$ sudo ./VBoxLinuxAdditions.run
在一些输出之后,将打印此行:
The headers for the current running kernel were not found.
但是已经安装了标头,至少对应于dpkg
:
$ dpkg --get-selections | grep linux-headers
linux-headers-3.0.0-12 install
linux-headers-3.0.0-12-server install
linux-headers-server install
运行的内核是:
$ uname -a
Linux foobar 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 X86_64 GNU/Linux
如何解决问题,以便Guest Additions安装程序能够找到内核标头?
更新:添加了完整的输出。
The headers for the current running kernel were not found. If the module compilation fails then this could be the reason.
Building the main Guest Additions module ...done.
Building the shared folder support module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Installing the Window System drivers ...fails!
(Could not find the X.Org or XFree86 Window System).
我不在乎失败#2,因为那是一台服务器,并且我不需要X服务器。但是我需要共享文件夹支持。
一些进一步的细节:
$ tail /val/log/vboxadd-install.log
..........
cc1: some warnings being treated as errors
make[2]: *** [/tmp/vbox.0/vfsmod.o] Error 1
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxsf] Error 2