我在我的环境中使用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

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


当前回答

当你做vagrant init时,它会替换你的repo中的vagrant文件,并给你这个错误。所以我建议你从远程复制原始的vagrant文件或备份的vagrant文件,然后试试vagrant。

我遇到了同样的问题,我只是从我的远程回购复制了流浪者文件,并替换了我试图运行的流浪者文件。这将使流浪文件中的配置与虚拟机同步。

其他回答

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

相反,你可以试试

$ vagrant init hashicorp/precise32 $ vagrant up

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

我在运行以下命令时也遇到了同样的问题

vagrant init
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: Box file was not detected as metadata. Adding it directly...
==> 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 /home/...../base

我用

>vagrant init laravel/homestead
>Vagrant up

这对我很管用。

快乐的编码

发生这种情况是因为有一个没有定义框名的流浪文件。这种情况发生在你运行vagrant init时不带框名参数。

所以你必须删除流浪者的文件

vagrant init box-title
vagrant up

我希望这能有所帮助!

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

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

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

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