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

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


当前回答

检查Vagrantfile中的以下条目

Every Vagrant development environment requires a box.
You can search for boxes at https://vagrantcloud.com/search.
  config.vm.box = "base"

这是使用vagrant init命令创建的默认文件设置。但你需要做的是用操作系统初始化流浪环境。例如$vagrant init centos/7。Vagrantfile看起来是这样的:

Every Vagrant development environment requires a box.
You can search for boxes at https://vagrantcloud.com/search.
  config.vm.box = "centos/7"

这将解决做流浪者时找不到基地的错误。

其他回答

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

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 box list

您将看到类似laravel/homestead(virtualbox,x.x.x)的内容。

接下来找到你的Vagrantfile,找到上面写着的那行

config.vm.box = "box"

运行流浪箱列表时,将箱替换为箱名。

您也可以将vm添加到您的机器

vagrant box add precise32 http://files.vagrantup.com/precise32.box

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

相反,你可以试试

$ vagrant init hashicorp/precise32 $ vagrant up

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

如果你使用的是OS X并且使用了标准安装,删除vagrant的旧curl,它现在应该可以工作了

Sudo rm /opt/vagrant/embedded/bin/curl