環境
- Windows 10 Home (ほぼクリーンインストール時)
- Vagrant 1.8.1
症状
vagrant box add centos https://f0fff3908f081cb6461b407be80daf97f07ac418.googledrive.com/host/0BwtuV7VyVTSkUG1PM3pCeDJ4dVE/centos7.box
を実行してboxを追加しようとすると、以下のエラーが出る
An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.
下にエラー詳細が出るって書いてあるのに何も出力されてなくて、「何だこれ」ってなってた。
解決方法(直球)
- Download Microsoft Visual C++ 2010 再頒布可能パッケージ (x86) from Official Microsoft Download Center
- Download Microsoft Visual C++ 2010 再頒布可能パッケージ (x64) from Official Microsoft Download Center
上記をインストールして完了。
以下、詳細。
Vagrantのエラーログ
set VAGRANT_LOG=DEBUG
を実行すると、コマンドプロンプト上でVagrantのデバッグログを出力することが可能。
この状態で、再び vagrant box add ***
を実行。
~省略~ ERROR vagrant: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/downloader.rb:206:in `execute_curl' ~省略~
どうやら、downloader.rb
の206行目でエラーが発生している模様。
そのあたりを探していると、どうやらcurl.exe
を実行している模様。
そのcurl.exe
はC:\HashiCorp\Vagrant\embedded\bin\curl.exe
にある。
試しに実行してみると、
ビンゴのようですね。
あとは、グーグル先生に聞くと、以下の記事がヒットしました。
- Download Microsoft Visual C++ 2010 再頒布可能パッケージ (x86) from Official Microsoft Download Center
- Download Microsoft Visual C++ 2010 再頒布可能パッケージ (x64) from Official Microsoft Download Center
をインストールすれば良いみたいです。
32bitか64bitか自信がなかったので、両方インストールしました。
インストールしてから再度 vagrant box add ***
を実行すると、無事にboxが追加されました。