zicjin
zicjin

Reputation: 351

vagrant can't find existing box

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

Upvotes: 6

Views: 7888

Answers (4)

Emile Bergeron
Emile Bergeron

Reputation: 17430

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.

Upvotes: 1

Ganesan Murugesan
Ganesan Murugesan

Reputation: 145

$ vagrant box add CentOSMinimal  https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
 $ vagrant init CentOSMinimal
 $ vagrant up

Upvotes: 1

Gabriel Gcia Fdez
Gabriel Gcia Fdez

Reputation: 670

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

Upvotes: 0

Sergey Evstifeev
Sergey Evstifeev

Reputation: 5358

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)

Upvotes: 7

Related Questions