在 Windows 7 上流浪:设置证书验证位置时出错



我刚遇到Vagrant,试图通过入门说明 https://www.vagrantup.com/intro/getting-started/index.html

在深入研究您的第一个项目之前,请安装最新版本的 Vagrant。而且由于我们将使用VirtualBox作为入门指南的提供商,因此也请安装它。

我的主机是Windows 7 x64.Virtualbox5.1.14r112924.虚拟化已启用:我已成功使用 Windows XP 虚拟机。

所以我安装了最新的Vagrant版本2.0.0.我将Powershell2.0更新为5.0以修复vagrant up没有任何问题。

因此,入门中的说明:

  1. vagrant init hashicorp/precise64:好的,文件Vagrantfile出现;
  2. vagrant up,入门说:

运行上述两个命令后,您将在VirtualBox中拥有一个运行Ubuntu 12.04 LTS 64位的完全运行的虚拟机。

但我看到:

E:VMv_demo>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
The box 'hashicorp/precise64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's 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/precise64"]
Error: error setting certificate verify locations:
CAfile: /mingw64/ssl/certs/ca-bundle.crt
CApath: none

并在我的工作文件夹中以下文件树:

|   Vagrantfile
|
---.vagrant
---machines
---default
---virtualbox
vagrant_cwd

互联网搜索此错误显示的结果curlиgit但此处不使用它们。

有关尝试从错误消息中vagrant login的建议也不清楚。正如在 https://www.vagrantup.com/docs/cli/login.html 所说

命令:流浪登录

登录命令用于向HashiCorp的流浪者进行身份验证 云服务器。仅当您访问受保护时,才需要日志记录 框或使用流浪者共享。

登录不是使用Vagrant的必要条件。绝大多数 流浪者不需要登录。仅某些功能,例如 受保护的盒子或流浪者共享需要登录。

我不认为该测试示例是私有的。 而且我在任何地方都找不到Create account按钮。

我错过了什么?

UPD

Vagrantfile

Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.box_download_insecure = true
end

价值config.vm.box_download_insecure = true没有帮助:相同的结果。

UPD2我已经找到了如何创建帐户 https://app.vagrantup.com/account/new(在我使用移动版本之前)。vagrant login没有帮助:相同的结果

实际问题是代理服务器。 设置环境变量Windowshttps_proxy=http://192.168.x.xxx:3128解决了这个问题。

手动解决方案:

  1. 手动将.box文件从 https://hashicorp-files.hashicorp.com/precise64.box 下载到本地文件夹local_boxprecise64.box;
  2. Vagrantfile内添加本地.box-file 的路径:

    Vagrant.configure("2") do |config|
    config.vm.box = "local_box/precise64.box"
    end
    
  3. vagrant up现在按预期工作。

最新更新