0

我已经在我的 win 7 64 位系统中成功安装了 VMware 和 vagrant。

我正在尝试使用 vagrant 使用以下命令安装 Fedora:

1) vargrant init chef/fedora-20

输出:

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

2)流浪起来

输出:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'chef/fedora-20' could not be found. Attempting to find and ins
tall...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'chef/fedora-20' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, 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://atlas.hashicorp.com/chef/fedora-20"]
Error: Failed connect to atlas.hashicorp.com:443; No error

我可以在浏览器中访问 atlas.hashicorp.com。

4

2 回答 2

3

命令vagrant up失败,因为我的代理拒绝访问 atlas.hashicorp.com。如果我们可以使用浏览器访问任何网站,并不意味着我们可以使用命令提示符访问它。默认情况下,命令提示符不使用 Internet Explorer 中的代理设置。为了解决这个问题,我创建了 2 个环境变量:“ http_proxy ”和“ https_proxy ”。

windows下创建环境变量的步骤:

  1. 打开控制面板并单击系统图标。显示系统属性对话框。
  2. 在高级选项卡上,单击环境变量。将显示环境变量对话框。
  3. 在系统变量面板中单击新建。将显示新建系统变量对话框。
  4. 使用适当的代理信息添加 http_proxy 和 https_proxy

使用代理服务器的主机名或 IP 地址设置http_proxyhttps_proxy变量:http_proxy= http://proxy.example.org

如果代理服务器需要用户名和密码,请将它们包含在以下格式中:http_proxy= http://username:password@proxy.example.org

如果代理服务器使用 80 以外的端口,请包括端口号:http_proxy= http://username:password@proxy.example.org:8080

于 2015-03-03T07:03:21.723 回答
0

对我来说,“chef/fedora-20”框使用您的步骤可以正常工作。这可能是一些访问问题。

作为替代方案,您可以尝试使用以下方式下载该框:

vagrant box add chef/fedora-20

然后尝试相同vagrant up

于 2015-02-27T15:10:07.703 回答