【问题标题】:Unable to do vagrant up behind proxy无法在代理后面做 vagrant up
【发布时间】:2017-10-26 11:26:39
【问题描述】:

我无法在 Windows 7 机器上的公司代理后面执行 vagrant up(或 vagrant add)。我尝试过使用和不使用 http_proxy/https_proxy 环境变量。我尝试将 vagrant 插件 vagrant-proxyconf 与各种 http 代理设置一起使用,但没有帮助,问题不在于客人的代理,而在于主机的代理。有没有办法让 vagrant 自己使用代理?

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

插件:

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

流浪版本:

C:\scratch\vagrant>vagrant -v
Vagrant 1.5.4

【问题讨论】:

  • 有一个错字:正确的盒子名称可能是“hashicorp/precise32”
  • 是的,这似乎是 Emyl 的问题。感谢您的关注。我一直在与代理问题作斗争,并且沿线的某个地方掩盖了盒子名称。 @tmatilai 在下面使用环境代理变量的回答有效。

标签: vagrant


【解决方案1】:

正如@Emyl 指出的那样,您在框名中有错字(应该是“hashicorp/precise32”)。

作为对这个问题的回答,Vagrant 在主机上支持标准的HTTP_PROXYHTTPS_PROXY 环境变量。在 Windows 上,您可以在命令行上设置它们:

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

planned 也是planned 未来vagrant-proxyconf 也可以在某些情况下自动设置它们。

【讨论】:

  • 是的,上面的错字和修复后可以正常工作。谢谢!
  • 双引号对我不起作用。我必须删除它们。
  • 好吧,你怎么知道代理信息是问题??
【解决方案2】:

为我工作,但没有双引号。

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

而不是:

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

【讨论】:

  • 认为这应该是公认的答案,因为双引号会导致 vagrant 错误(“不支持的代理方案”)
猜你喜欢
  • 2015-09-23
  • 1970-01-01
  • 2016-11-12
  • 1970-01-01
  • 2016-05-03
  • 1970-01-01
  • 2015-05-14
  • 2016-01-11
  • 2017-08-18
相关资源
最近更新 更多