我无法在托管于 Xubuntu 16.04 的 Xubuntu 17.10 客户机上安装客户机添加功能。
我启动了主机,单击了设备,插入客户机附加 CD,iso 下载到我的主机上,然后作为 CD 插入客户机。然后我运行sudo ./VBoxLinuxAdditions.run
并得到以下错误输出:
myuser@myuser-VirtualBox:/media/myuser/VBOXADDITIONS_5.0.40_115130$ sudo ./VBoxLinuxAdditions.run
[sudo] password for myuser:
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.40 Guest Additions for Linux............
VirtualBox Guest Additions installer
You appear to have a version of the VBoxGuestAdditions software
on your system which was installed from a different source or using a
different type of installer. If you installed it from a package from your
Linux distribution or if it is a default part of the system then we strongly
recommend that you cancel this installation and remove it properly before
installing this version. If this is simply an older or a damaged
installation you may safely proceed.
Do you wish to continue anyway? [yes or no]
yes
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
update-initramfs: Generating /boot/initrd.img-4.13.0-16-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-17-generic
grep: /opt/VBoxGuestAdditions-*/init/*: No such file or directory
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions ...done.
这就是我尝试安装当前内核的标头的原因:
ruby@ruby-VirtualBox:/media/myuser/VBOXADDITIONS_5.0.40_115130$ sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-4.13.0-17-generic is already the newest version (4.13.0-17.20).
linux-headers-4.13.0-17-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
但它们已经是最新的了,那么这里的问题是什么?我也不明白,这You appear to have a version of the VBoxGuestAdditions software on your system
是怎么回事。到目前为止,我只安装了virtualbox-guest-dkms
。这可能是个问题吗?
答案1
所以,问题确实是,客户机中的内核比主机中的内核新。我不知道如何真正解决这个问题,但我刚刚在虚拟机中安装了 Xubuntu 16.04,然后它运行良好。