じっぱひとからげ

十把一絡げになんでもかんでもつづる。

Solution of "vagrant add" error (An error occurred while downloading the remote file.)

Now I'd like to use Ansible for configuration management of our production invironment, so I built testing invironment for Ansible according to this reference( http://qiita.com/t_nakayama0714/items/fe55ee56d6446f67113c ).

This reference is good to build testing invironment. It's very simple.  You can built the invironment to just have to trace it.  But there was only one error caused by Mac OS so I'll introduced to you this solution.

The error message was below.

$ vagrant box add centos6.7 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos6.7' (v0) for provider:
box: Downloading: https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

 

I thought I had the trouble duaring donloading this file.  but I tried to acccess this URL by the browzer, I could download this file.

This article(http://stackoverflow.com/a/40501585 ) said curl in Vagrant is something wrong so you should remove this command in Vagrant.  If you removed curl in Mac OS, it uses original curl in it.

I removed curl in Vacant.

$ sudo mv /opt/vagrant/embedded/bin/curl /tmp

So I succeed to download Box.

$ vagrant box add centos6.7 https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos6.7' (v0) for provider:
box: Downloading: https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box
==> box: Successfully added box 'centos6.7' (v0) for 'virtualbox'!