无法安装 VirtualBox 客户机添加程序

无法安装 VirtualBox 客户机添加程序

我正在尝试让共享文件夹与我的 Vagrant 机器一起工作(主机是 Ubuntu 16.04,客户机是 CentOS 6)。当我启动它时,机器 Vagrant 抱怨道:

default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default: 
default: Guest Additions Version: 4.3.26
default: VirtualBox Version: 5.1

因此,我尝试升级客户添加项,使其适合 VBox 版本。我选择设备 > 插入客户添加项 CD 映像...什么都没发生,但我可以看到它已安装。现在我应该导航到/media并运行sudo ./VBoxLinuxAdditions.run,但我找不到任何相关内容/media。我尝试了建议的解决方案这里,但打字sudo mount /dev/sr0 vbox/让我mount: special device /dev/sr0 does not exist

有任何想法吗?

答案1

由于这仍然没有答案:

  1. 安装dotless 的 vbguest vagrant 插件
  2. 从以下位置下载相应的 VirtualBox 客户机附加组件映像http://download.virtualbox.org/virtualbox/(将其保存为“VBoxGuestAdditions.iso”到 Vagrantfile 所在的同一文件夹)
  3. 在您的主机上,在 Vagrantfile 所在的文件夹中(现在还有 VBoxGuestAdditions.iso)执行:$ vagrant vbguest --do install --iso VBoxGuestAdditions.iso

如果出现错误:

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]

Cancelling installation.
An error occurred during installation of VirtualBox Guest Additions 5.1.0. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Failed to start vboxadd.service: Unit not found.

您的客户机系统的 /opt 目录中可能有一个“VBoxGuestAdditions-xxx”文件夹,这表明 VBoxGuestAdditions 之前已安装,但未使用 vbguest 插件安装。对我来说,该文件夹是空的。删除该文件夹并重新运行 vbguest。

请参阅以下链接以获取更多故障排除信息:

相关内容