如何在VM框上升级到VirtualBox Guest Additions?

odi*_*ity 49 ubuntu virtualbox vagrant

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

我正在使用Vagrant运行基于示例64位Ubuntu 12.04 LTS框的VM:

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
Run Code Online (Sandbox Code Playgroud)

我用谷歌搜索,但我找不到升级到Guest Additions v4.3的方法.Ubuntu存储库中的最新版本精确到4.1,并且官方VirtualBox下载页面上没有下载链接.

Emy*_*myl 61

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

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

对于Vagrant≥1.1

vagrant plugin install vagrant-vbguest

流浪汉1.0及以上

vagrant gem install vagrant-vbguest

  • 我执行了“vagrant plugin install vagrant-vbguest”,但仍然收到警告“Installing Virtualbox Guest Additions 6.1.32 - guest version is 6.1.30”。 (2认同)

ken*_*orb 12

现有VM

通过以下方式检查主机和客户版本:

vagrant vbguest --status
Run Code Online (Sandbox Code Playgroud)

或者对于特定的VM:

VBoxManage guestproperty get <UUID> /VirtualBox/GuestAdd/Version
Run Code Online (Sandbox Code Playgroud)

哪里<UUID>可以找到VBoxManage list vms.

然后尝试通过以下方式更新您的访客添加

VBoxManage guestcontrol <uuid/vmname> updatega|updateguestadditions|updateadditions
Run Code Online (Sandbox Code Playgroud)

或者在VM中再次安装它:

vagrant vbguest --do install
Run Code Online (Sandbox Code Playgroud)

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

/Applications/VirtualBox.app/Contents/MacOS/VBoxManage guestproperty set "new_version" /VirtualBox/GuestAdd/Version
Run Code Online (Sandbox Code Playgroud)

注意:new_version改为正确的

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

/opt/VirtualBoxGuestAdditions/uninstall.sh
rm -rf /tmp/Virtualbox; sudo reboot;
Run Code Online (Sandbox Code Playgroud)

要再次安装它:

VAGRANT_LOG=info vagrant vbguest --do install
Run Code Online (Sandbox Code Playgroud)

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

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


新VM

如果上面没有帮助,并且所有新VM都会发生这种不匹配警告,您需要升级VirtualBox或从VirtualBox网站下载VBoxGuestAdditions ISO文件(使用正确的版本,以便它们匹配)并手动替换它.

在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
Run Code Online (Sandbox Code Playgroud)

其中VBoxGuestAdditions的版本应与已安装的VirtualBox二进制文件匹配.

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

brew cask update
brew install Caskroom/cask/vagrant # Or: brew cask install Caskroom/cask/vagrant
Run Code Online (Sandbox Code Playgroud)

新VM(已有Vagrantfile)

如果以前使用现有Vagrantfile的新VM发生这种情况,问题可能在于下载您的盒子的元数据(例如,盒子已从您的提供者中删除,例如Atlas),这可能导致回退到默认设置,因此确保你config.vm.box在你Vagrantfile所指向的有效VM箱或者你一些临时的网络问题.


有关更多详细信息和故障排除,请查看:Oracle VM VirtualBox用户手册PDF.


小智 5

这对我来说非常有效。
假设虚拟机正在运行(否则启动它)。
假设您位于 Vagrant 文件所在的目录中。
做:

# vagrant plugin install vagrant-vbguest 
# vagrant halt
# vagrant up
# vagrant halt
# vagrant up
Run Code Online (Sandbox Code Playgroud)
是的,我停止/启动了两次,因为 vagrant 需要修复一些不一致的地方。
我还在目录中提供了 VBoxGuestAdditions_6.0.20.iso 的链接
,但我认为这并不重要。
祝你好运!