我添加了来自https://dl.dropboxusercontent.com/s/x1085661891dhkz/lxc-centos6.5-2013-12-02.box
的本地文件框vagrant box add centos centos.box
vagrant init centos
我的shell:
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
答案 0 :(得分:7)
使用带有文件协议URI的完整路径添加本地文件夹文件。例如:
vagrant box add centos file:///Users/zicjin/Work/vagrant-centos/centos.box
(当然,确切的位置取决于您放置文件的位置)
答案 1 :(得分:1)
$ vagrant box add CentOSMinimal https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
$ vagrant init CentOSMinimal
$ vagrant up
答案 2 :(得分:1)
如果您使用的是Windows,则可以将路径定义为:
vagrant box add box_name "C:\Users\JohnDoe\blahblah\box_name.box"
注意路径末尾的.box
。
如果您还没有cd
,那么您可以vagrant up
进入该目录。
答案 3 :(得分:0)
我已经解决了将Vagrant升级到最新版本的类似问题,并且奇迹般地有效......:/