Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to do vagrant up behind proxy

Tags:

vagrant

I am unable to do a vagrant up (or vagrant add) behind our corporate proxy on a Windows 7 machine. I have tried with and without http_proxy/https_proxy environment variables. I tried using the vagrant plugin vagrant-proxyconf with the various http proxy settings but it did not help, the issue isn't with the guest's proxy it is with the host's. Is there some way to get vagrant itself to use a proxy?

Output from vagrant up:

C:\scratch\vagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/pricise32' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
The box 'hashicorp/pricise32' could not be found or
could not be accessed in the remote catalog. If this is a private
box on Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://vagrantcloud.com/hashicorp/pricise32"]
Error: The requested URL returned error: 404 Not Found

Plugins:

C:\scratch>vagrant plugin list
vagrant-login (1.0.1, system)
vagrant-proxyconf (1.2.0)
vagrant-share (1.0.1, system)

Vagrant version:

C:\scratch\vagrant>vagrant -v
Vagrant 1.5.4
like image 968
Dave Remy Avatar asked Apr 29 '14 13:04

Dave Remy


2 Answers

As @Emyl pointed out, you have a typo in the box name (should be "hashicorp/precise32").

As an answer to the question, Vagrant supports the standard HTTP_PROXY and HTTPS_PROXY environment variables on the host. On Windows you can set them on the command line with:

set HTTP_PROXY="http://proxy:1234"
set HTTPS_PROXY="http://proxy:1234"

It's also planned that in the future vagrant-proxyconf could also set them automatically in some cases.

like image 58
tmatilai Avatar answered Oct 08 '22 21:10

tmatilai


Worked for me but without the double quotes.

set HTTP_PROXY=http://proxy:1234
set HTTPS_PROXY=http://proxy:1234

instead of :

set HTTP_PROXY="http://proxy:1234"
set HTTPS_PROXY="http://proxy:1234"
like image 28
Aimed Chaieb Avatar answered Oct 08 '22 21:10

Aimed Chaieb