我在我的环境中使用Vagrant,我遇到了一个小问题:

$vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
    default: Downloading: base

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/.../base

我已经初始化了我的项目与流浪者初始化,但出于某种原因流浪者拒绝工作。


当前回答

我也经历过这种错误。 我认为这是因为我没有提供一个box_url..

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

其他回答

如果您添加了一个方框并开始下载,但中断了下载,请转到~/.vagrant。删除部分下载文件,然后重试。

如果“Vagrantfile”已经在这个目录中存在。在运行“vagrant init”之前删除它。 错误显示

1. rm Vagrantfile
2. vagrant init hashicorp/precise64
3. vagrant up

看起来你可能已经创建了一个Vagrant项目,只是Vagrant init。这将创建您的Vagrantfile,但它不会定义一个框。

相反,你可以试试

$ vagrant init hashicorp/precise32 $ vagrant up

它使用标准的Ubuntu映像。Vagrant网站上有一个Getting Started,上面给出了一些很好的例子。

vagrant init laravel/homestead

然后

vagrant up

这对我很有效。

这是我在Windows 10上的工作:https://stackoverflow.com/a/31594225/2400373

但使用命令后,需要删除文件:Vagranfile:

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

之后,

vagrant up