vagrant can't find existing box

我的梦境 提交于 2021-02-07 13:18:53

问题


i was add box with local file from https://dl.dropboxusercontent.com/s/x1085661891dhkz/lxc-centos6.5-2013-12-02.box

vagrant box add centos centos.box

vagrant init centos

my 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

回答1:


Add the local box file using the full path with the file protocol URI. For instance:

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

(the exact location of course depends on where you've put the file)




回答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:


If you're on windows, you can define the path as:

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

Notice the .box at the end of the path.

Then you can cd into the directory if you're not already there and do vagrant up.




回答4:


I've solved a similar issue upgrading Vagrant to the latest version and magically it works... :/



来源:https://stackoverflow.com/questions/23183217/vagrant-cant-find-existing-box

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!