首页 文章

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

提问于
浏览
46

我已经在桌面上安装了最新版本的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

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

3 回答

  • 57

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

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

    对于Vagrant≥1.1

    vagrant plugin install vagrant-vbguest

    流浪汉1.0及以上

    vagrant gem install vagrant-vbguest

  • 2

    现有VM

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

    vagrant vbguest --status
    

    或者对于特定的VM:

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

    其中 <UUID> 可以在 VBoxManage list vms 找到 .

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

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

    或者在VM中再次安装它:

    vagrant vbguest --do install
    

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

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

    注意:将new_version更改为正确的

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

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

    要再次安装它:

    VAGRANT_LOG=info vagrant vbguest --do install
    

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

    来源:Issues removing and updating box additions with Virtualbox 4.3 #95在GitHub


    新VM

    如果上面没有帮助,并且所有新VM都会发生此不匹配警告,则需要升级VirtualBox或从VirtualBox website下载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
    

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

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

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

    新VM(包含现有的Vagrantfile)

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


    有关更多详细信息和故障排除,请检查:Oracle VM VirtualBox User Manual PDF .

  • 7

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

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

相关问题