Pao*_*olo 81 virtualbox kernel
我正在尝试在 VirtualBox 4.04 中安装 Guest Additions。主机操作系统是 Ubuntu 桌面 11.04 64 位,来宾操作系统是 Ubuntu 服务器 11.10 64 位。
$ sudo ./VBoxLinuxAdditions.run
Run Code Online (Sandbox Code Playgroud)
一些输出后,这一行被打印出来:
The headers for the current running kernel were not found.
Run Code Online (Sandbox Code Playgroud)
但头都安装在相应至少到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
Run Code Online (Sandbox Code Playgroud)
正在运行的内核是:
$ 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
Run Code Online (Sandbox Code Playgroud)
如何解决问题以便 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).
Run Code Online (Sandbox Code Playgroud)
我不在乎失败 #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
Run Code Online (Sandbox Code Playgroud)
小智 173
该消息具有误导性。
在我的情况下,它实际上缺少 dkms 所以在你安装加法运行之前
sudo apt-get install build-essential linux-headers-`uname -r` dkms
Run Code Online (Sandbox Code Playgroud)
Ash*_*Ash 17
(即使这个问题有一个公认的答案,我还是添加了这个答案,以防它帮助其他人......)
虽然我有相同的症状,但我尝试了对这个问题的所有建议,但没有任何效果。我终于发现这个线程暗示它的 VirtualBox 版本没有与 Linux 内核版本保持同步。
因此,如果没有任何效果,请尝试从以下位置安装最新版本:http : //download.virtualbox.org/virtualbox/(在撰写本文时,这是基于 Debian 的系统的4.2.6)。
小智 10
关于您需要 X 来使用来宾添加的答案只是荒谬。它在安装 X 后工作的原因是它拉取 libglib 作为依赖项,但安装整个 X 服务器只是为了让添加运行是非常不必要的。
您需要的所有软件包如下:
显然,这只是您需要的 build-essential 和 libglib 的一部分,但与其确切地调查哪些包是必需的,不如让它们提取依赖关系更容易。
旁注是,这些软件包与 vmware 机器上的 vmware 等效“VMware Tools”所需的软件包完全相同。
小智 9
使用以下命令安装建议的软件包后:
sudo apt-get install build-essential linux-headers-`uname -r` dkms
我按照 dwurf 的建议升级了我的 VirtualBox 版本。那为我修好了。
要让 VirtualBox ubuntu 服务器来宾正确接受来宾添加安装,您需要安装最小的 xorg 包:
sudo apt-get install xserver-xorg xserver-xorg-core
Run Code Online (Sandbox Code Playgroud)
通过这样做,您将获得共享文件夹支持。
正如您所发现的,来宾添加是一个非常大的脚本 - “VBoxLinuxAdditions.run”
您也许可以取消选择此文件 - 我不推荐它,因为随着新版本的 virtualbox 发布,guest-additions 的版本通常也会受到影响。
此外,我建议(如果您还没有),安装dkms. 当更新较新的 ubuntu 内核时,guest-additions 内核模块将自动编译。如果没有dkms在内核更新由你将失去你的共享文件夹支持。