Vagrant machine proxy configuration

To configure proxy for a Vagrant host:
1. put the following configuration in the Vagrant file

authenticating proxy:


if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://USERNAME/PASSWORD@PROXYADDRESS:PROXYPORT"
config.proxy.https = "http://USERNAME/PASSWORD@PROXYADDRESS:PROXYPORT"
config.proxy.no_proxy = "localhost,127.0.0.1,.HOSTNAME.com"
end

Not


if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://PROXYADDRESS:PROXYPORT"
config.proxy.https = "http://PROXYADDRESS:PROXYPORT"
config.proxy.no_proxy = "localhost,127.0.0.1,.HOSTNAME.com"
end

replace the following keywordt with the real data:
USERNAME
PASSWORD
PROXYADDRESS
PROXYPORT
Ex: vagrantuser/vagrantpassword@vagranthost:8080

2: restart the host or alternatively, execute “vagrant provision”
This configuration creates a new file in the “/etc/apt/apt.conf.d” directory with the name: “XXproxy” where XX is the execution number like 01proxy.

If the configuration does not works, check this directory if there is another proxy configration which overrides this configuration.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s