Vagrant box could not be found error
Asked Answered
C

3

7

I am trying to set up virtual machine using virtual box. I have got virtual box and vagrant installed in my windows 7 64-bit machine. I have also built an environment using puphpet. But whenever I try to install the box ubuntu1404-x64 it throws the error

Bringing machine 'machine1' up with 'virtualbox' provider...
==>Machine1: Box 'puphpet/ubuntu1404-x64' could not be found. Attempting to find and install...
machine1: Box Provider: virtualbox
machine1: Box Version: >= 0
machine1: Box file was not detected as metadata. Adding it directly...
machine1: Adding box 'puphpet/ubuntu1404-x64' (v0) for provider: virtualbox
machine1: Downloading: puphpet/boxes/ubuntu1404-x64
machine1:
An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

I checked the URL https://atlas.hashicorp.com/puphpet/boxes/ubuntu1404-x64/ and the box puphpet/ubuntu1404-x64 does exist.

Also when it says The error message, if any, is reproduced below it does not show any description at the terminal.

I googled the issue, tried some of the answers here at stackoverflow but no result. Please help.

Conversant answered 5/9, 2016 at 6:37 Comment(1)
I have gone through its documentation and it says there the box requires a metadata.json file in it. Now when I run vagrant up through my cmd it says box file not detected as metadata.Conversant
S
8

I've had a similar situation in the past, and it helped me to download the box using vagrant command line, instead of having it be downloaded automatically ( from the URL in Vagrantfile ):

$ vagrant box add USER/BOX

see more here. Could you try the same approach? It might work for you as well.

EDIT: on a windows box, Microsoft Visual C++ 2010 redist looks to be needed to perform the provisioning of the box. It can be downloaded here. More info on the puhpet issuet: here

Sacrarium answered 5/9, 2016 at 6:47 Comment(8)
Thanks for the info Geo, I looked through their documentation but the problem persists. The box could not be found.Conversant
Does the URL for the box exist and is valid? If so, here's an example of how I used it: vagrant box add ubuntu-1464 https://github.com/kraksoft/vagrant-box-ubuntu/releases/download/14.04/ubuntu-14.04-amd64.box . And then, in my vagrant file I just configured the box name to be ubuntu-1464 and I removed the URL. This made vagrant find it in the list of locally installed boxes.Sacrarium
I tried downloading from github as well but still the same. Also I downloaded the box file manually and tried to vagrant box add name local_box_file but still it is throwing the same error.Conversant
And in your Vagrantfile, you referenced it as the local name, and removed the URL, right?Sacrarium
Yes, I deleted the complete box URL lineConversant
Could it be related to the version of vagrant? I notice that I have 1.8.5 locally.Sacrarium
Mine is the same.Conversant
Let us continue this discussion in chat.Conversant
S
3

I ran into a similar problem and fixed it by installing the latest version of vagrant.

Shannonshanny answered 25/4, 2018 at 8:28 Comment(0)
H
0

It kept telling me :The revocation function was unable to check revocation for the certificate

I searched for it and found the same error in this repo chat :

https://github.com/hashicorp/vagrant/issues/13102

The solution (for me at least) was to add this line to the vagrant file: at the line where it begins : Vagrant.configure("2") do |config|

add this line below it : config.vm.box_download_options = {"ssl-no-revoke" => true}

so the final form should be :

Vagrant.configure("2") do |config|
    // leave any already written lines as it is 

    config.vm.box_download_options = {"ssl-no-revoke" => true}  

then save the file

It worked for me and completed the download

Note : this solution may have cause tiny security issues for your machine , because it effectively disables SSL certificate revocation checks during the download of the base box image for your virtual machine , but i am posting this as it was the only way I personally found to help me solve this problem.

Harrier answered 8/9, 2023 at 15:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.