Vagrant + proxy

proxy環境下でvagrant利用する方法:

vagrant box add centos-7.2 https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.2/vagrant-centos-7.2.box

上記実行後、以下のエラーが出力された。

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

vagrant plugin expunge --reinstall


proxyプラグインのインストールで解決
(proxy設定値は環境変数から読み込んでくれる模様: http_proxy)

vagrant plugin install vagrant-proxyconf
Installing the 'vagrant-proxyconf' plugin. This can take a few minutes...
Fetching: vagrant-proxyconf-1.5.2.gem (100%)
Installed the plugin 'vagrant-proxyconf (1.5.2)'!

関連記事読むとVagrantfileにproxy設定の記述が必要とあるが
これは仮想環境上でネットワーク利用に必要な設定。