Windows 8.1:Vagrant无法检测到VirtualBox!确保正确安装VirtualBox

时间:2014-09-21 21:06:31

标签: vagrant

这个问题是我将回答的问题,希望任何有同样问题的人能够解决问题,而不会像我那样过多地敲击!

我按照其网站上的说明安装了VirtualBox(4.3.16)和Vagrant(1.3.5)。在我完成命令运行之前,所有这些都显得非常清晰和简单:vagrant up

这立即返回错误:

Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.

Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.

这是一个惊人的错误信息......我应该在哪里找到这个PATH变量???

4 个答案:

答案 0 :(得分:11)

您需要从提升的提示符运行vagrant,即cmd需要“以管理员身份运行”。

Vagrant(或VBoxManage.exe,就此问题而言)不需要在您的PATH环境变量中。 Virtual Box安装程序会自动设置Vagrant用于查找的VBOX_INSTALL_PATHVBOX_MSI_INSTALL_PATH环境变量,但Vagrant除非升高,否则无法运行它。

答案 1 :(得分:7)

我找到了很多关于如何解决这个问题的建议,但是直到我终于发现有人提到VirtualBox已经重命名了一个变量名称时才发现它们都没有帮助,我还没有找到其他地方,经过一些挖掘,这就是解决方案终于让事情奏效了:

查找以下文件(Windows 8.1上的默认安装路径):

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.3.5\plugins\providers\virtualbox\driver\base.rb

在您喜欢的文本编辑器中打开此文件并进行搜索并将VBOX_INSTALL_PATH的所有实例替换为VBOX_MSI_INSTALL_PATH

希望这可以帮助有人开始使用Vagrant和VirtualBox!

答案 2 :(得分:1)

对于Vagrant 1.6.5和Virtual Box 4.3.18,我相信只需在安装虚拟机后重新启动计算机就是一招(我也重新安装了Vagrant)

答案 3 :(得分:0)

我遇到了完全相同的问题,但是我从大约6个月前开始使用Vagrant版本,因此我更新到了最新版本,并且没有任何其他更改。

https://www.vagrantup.com/downloads.html

相关问题