How to use vagrant in a proxy environment?

前端 未结 12 908
太阳男子
太阳男子 2020-12-07 08:10

My company\'s network is using proxy. So when I use vagrant up, it showed me a 401 permission error.

How can I do some setting to use vagrant?

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 08:38

    You will want to install the plugin proxyconf since this makes configuring the proxy for the guest machines pretty straight forward in the VagrantFile

    config.proxy.http     = "http://proxy:8888"
    config.proxy.https    = "http://proxy:8883"
    config.proxy.no_proxy = "localhost,127.0.0.1"
    

    However, there's quite a few things that could still go wrong. Firstly, you probably can't install vagrant plugins when behind the proxy. If that's the case you should download the source e.g. from rubygems.org and install from source

    $ vagrant plugin install vagrant-proxyconf --plugin-source file://fully/qualified/path/vagrant-proxyconf-1.x.0.gem
    

    If you solve that problem you might have the fortune of being behind an NTLM proxy, which means that if you are using *nix on your guest machines then you still have some way to go, because NTLM authentication is not supported natively There are many ways of solving that. I've used CNTLM to solve tht part of the puzzle. It acts as glue between standard authorization protocols and NTLM

    For a complete walk through, have a look at this blog entry about setting vagrant up behind a corporate proxy

提交回复
热议问题