【问题标题】:vagrant can't find existing box流浪汉找不到现有的盒子
【发布时间】:2015-05-07 03:15:50
【问题描述】:

我添加了来自https://dl.dropboxusercontent.com/s/x1085661891dhkz/lxc-centos6.5-2013-12-02.box的本地文件框

vagrant box 添加 centos centos.box

流浪初始化centos

我的外壳:

cheneytekimbp:vagrant-centos zicjin$ vagrant box list
centos  (lxc, 0)
lucid32 (virtualbox, 0)
cheneytekimbp:vagrant-centos zicjin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'centos' (v0) for provider: virtualbox
    default: Downloading: centos
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/zicjin/Work/vagrant-centos/centos

【问题讨论】:

  • 如果您已经下载,请使用vagrant box add /path/to/lxc-centos6.5-2013-12-02.box添加框。

标签: vagrant


【解决方案1】:

使用带有文件协议 URI 的完整路径添加本地 box 文件。例如:

vagrant box add centos file:///Users/zicjin/Work/vagrant-centos/centos.box

(当然,确切的位置取决于您将文件放在哪里)

【讨论】:

    【解决方案2】:
    $ vagrant box add CentOSMinimal  https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
     $ vagrant init CentOSMinimal
     $ vagrant up
    

    【讨论】:

      【解决方案3】:

      如果你在windows上,你可以将路径定义为:

      vagrant box add box_name "C:\Users\JohnDoe\blahblah\box_name.box"
      

      注意路径末尾的.box

      然后你可以cd 进入目录,如果你还没有进入目录并执行vagrant up

      【讨论】:

        【解决方案4】:

        我已经解决了将 Vagrant 升级到最新版本的类似问题,并且神奇地工作...:/

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-09-05
          • 1970-01-01
          • 1970-01-01
          • 2023-04-01
          • 2016-05-09
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多