如何升级到VM上的VirtualBox Guest Additions?

我在桌面上安装了最新版本的VirtualBox(4.3.4)。

我使用Vagrant来运行基于示例64位Ubuntu 12.04 LTS的虚拟机:

http://files.vagrantup.com/precise64.box

每当我跑上vagrant up ,我得到以下警告:

 The guest additions on this VM do not match the installed version of VirtualBox! In most cases this is fine, but in rare cases it can cause things such as shared folders to not work properly. If you see shared folder errors, please update the guest additions within the virtual machine and reload your VM. Guest Additions Version: 4.2.0 VirtualBox Version: 4.3 

我GOOGLE了,但我找不到升级到Guest Additions v4.3的方法。 Ubuntu存储库中的最新版本为4.1,在官方的VirtualBox下载页面上没有下载链接。

你可以看看下面的插件,它应该适合你的需求:

https://github.com/dotless-de/vagrant-vbguest

对于stream浪者≥1.1

vagrant plugin install vagrant-vbguest

Vagrant 1.0和更老的

vagrant gem install vagrant-vbguest

现有的VM

检查您的主机和访客版本:

 vagrant vbguest --status 

或针对特定的VM:

 VBoxManage guestproperty get <UUID> /VirtualBox/GuestAdd/Version 

其中<UUID>可以通过VBoxManage list vmsfind。

然后尝试更新您的客人补充:

 VBoxManage guestcontrol <uuid/vmname> updatega|updateguestadditions|updateadditions 

或者通过在VM中再次安装:

 vagrant vbguest --do install 

或者通过以下方式设置在VBox中logging的版本:

 /Applications/VirtualBox.app/Contents/MacOS/VBoxManage guestproperty set "new_version" /VirtualBox/GuestAdd/Version 

注意:将new_version更改为正确的

要在VM( vagrant ssh )中卸载guet,请执行以下操作:

 /opt/VirtualBoxGuestAdditions/uninstall.sh rm -rf /tmp/Virtualbox; sudo reboot; 

再次安装它:

 VAGRANT_LOG=info vagrant vbguest --do install 

最后重新检查: vagrant vbguest --status

来源: 使用 GitHub上的Virtualbox 4.3#95删除和更新框添加的问题


新的虚拟机

如果上面的内容不起作用,并且所有新虚拟机都会出现这种不匹配的警告,则需要升级VirtualBox或从VirtualBox网站下载VBoxGuestAdditions ISO文件(使用正确的版本,以便它们可以匹配)并手动进行replace。

在OS X上它在/Applications/VirtualBox.app/Contents/MacOS ,所以命令将是:

 sudo wget -O /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso http://download.virtualbox.org/virtualbox/5.0.14/VBoxGuestAdditions_5.0.14.iso 

VBoxGuestAdditions的版本应该与已安装的VirtualBox二进制文件匹配。

也考虑升级Vagrant,如果通过Homebrew安装,请尝试:

 brew cask update brew install Caskroom/cask/vagrant # Or: brew cask install Caskroom/cask/vagrant 

新的虚拟机(与现有的Vagrantfile

如果这种情况发生在现有Vagrantfile的新虚拟机上,那么可能是因为下载了你的盒子的元数据(例如,从你的提供者中删除了盒子,例如Atlas ),这可能导致回退到默认设置,确保您的Vagrantfileconfig.vm.box指向有效的VM框,或者您有一些临时的networking问题。


有关更多详细信息和疑难解答,请查看: Oracle VM VirtualBox用户手册PDF 。

在这里你可以下载官方的4.3.8 VBox Guest Additions ISO:

http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso