Using Vagrant With Proxy

 ·  · 

Setting up vagrant to use proxy.


1. Installation

Install vagrant-proxyconf plugin.

$ vagrant plugin install vagrant-proxyconf --plugin-source

If you meet a Bundler error with above command, make sure your http_proxy environment variable has been exported correctly.

$ export http_proxy=http://user:[email protected]_proxy_host:port

Then you can execute following command instead.

$ vagrant plugin install vagrant-proxyconf --plugin-source


2. Configuration

Edit Vagrantfile:

$ vim Vagrantfile

Add configuration lines below:

# file: Vagrantfile

Vagrant.configure("2") do |config|
  if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://your_proxy_server:port"
    config.proxy.https    = "http://your_proxy_server:port"
    config.proxy.no_proxy = "localhost,,"