总结:有了 Vbox5.1+,vagrant 坚持安装 5.0.1,但失败了。我现在从系统中移除了所有 VBox 实例,但 vagrant 不再安装它最喜欢的版本。如何强制 vagrant 再次安装 vbox?
我有一个Vagrantfile
想在 OSX 主机上使用的。
我已经安装了 VirtuaBox 5.1+。并VBoxManage --version
显示 5.1+ 版本。
我安装了 vagrant 并发出了vagrant up
。它解析了 Vagrantfile,下载了 vm 映像,然后开始下载和安装 VirtualBox 5.0.1。我试图取消,但它取消了整个 vagrant up 命令。
总之,没有办法避免 vagrant 下载 VirtualBox,即使它已经可以访问我系统中的 5.1+。所以我让它继续。它在我的 5.1+ 上安装了 5.0.1,VBoxManage --version
之后显示 5.0.1 就正常了。然而,vagrant up 失败,声称 VirtualBox 不可用。因为它显示了一条通知,在 Windows 上需要重新启动,所以我也重新启动了 OSX 以防万一。因此,我丢失了我收到的确切错误消息。
现在我尝试从我的系统中完全删除 VirtualBox。VBoxManage
找不到。rm -fr .vagrant ~/.vagrant.d
从我的 Vagrantfile 目录中。但vagrant up
现在,我不再像以前那样顽固地尝试下载虚拟盒,而是失败,提示找不到虚拟盒。
显然它存储在某个地方,不是记录的.vagrant
目录,它已经安装了 vbox,并且不应该再安装到那里。这些信息在哪里?
— 编辑1
我再次安装了 vbox 5.1.28。之后vagrant up
,它又坚持要再次下载 5.0.10。(我之前记错了是 5.0.1)。这是之前丢失的错误:
$ VBoxManage --version
5.1.28r117968
$ vagrant up
==> Provider 'virtualbox' not found. We'll automatically install it now...
The installation process will start below. Human interaction may be
required at some points. If you're uncomfortable with automatically
installing this provider, you can safely Ctrl-C this process and install
it manually.
==> Downloading VirtualBox 5.0.10...
This may not be the latest version of VirtualBox, but it is a version
that is known to work well. Over time, we'll update the version that
is installed.
==> Installing VirtualBox. This will take a few minutes...
You may be asked for your administrator password during this time.
If you're uncomfortable entering your password here, please install
VirtualBox manually.
[SUDO] Password:
==> VirtualBox has successfully been installed!
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
$ VBoxManage --version
5.0.10r104061
— 编辑2
vagrant 网站说支持 vbox 5.1:
VirtualBox 提供程序与 VirtualBox 版本 4.0.x、4.1.x、4.2.x、4.3.x、5.0.x 和 5.1.x 兼容。