如何解决Vagrant错误:`private_key_path`文件必须存在: [英] How to fix Vagrant error: `private_key_path` file must exist:

查看:916
本文介绍了如何解决Vagrant错误:`private_key_path`文件必须存在:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 PuPHPet 创建虚拟开发环境.

I've been using PuPHPet to create virtual development environments.

昨天我为一个新盒子生成了一个配置文件.当我尝试使用vagrant up命令将其旋转时,出现以下错误消息:

Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up command, I get the following error message:

C:\ xx>无所事事

C:\xx>vagrant up

通过"virtualbox"启动计算机默认" 提供者...本机的配置错误. 请更正以下错误,然后重试:

Bringing machine 'default' up with 'virtualbox' provider... There are errors in the configuration of this machine. Please fix the following errors and try again:

SSH: * private_key_path文件必须存在:P://.vagrant.d/insecure_private_key

SSH: * private_key_path file must exist: P://.vagrant.d/insecure_private_key

我遇到了这个问题,并移动了insecure_private_key从puphpet \ files \ dot \ ssh到Vagrantfile所在的目录.但这给出了相同的错误.

I came across this question and moved the insecure_private_key from puphpet\files\dot\ssh to the same directory as where the Vagrantfile is. However this gives the same error.

我也对错误消息中给出的目录感到困惑;

I'm also confused by the directory given in the error message;

P://.vagrant.d/insecure_private_key

P://.vagrant.d/insecure_private_key

为什么提到"P"驱动器?

Why is the 'P' drive mentioned?

可以在此处找到我的Vagrantfile.

My Vagrantfile can be found here.

赞赏有关解决此错误的任何建议.

Appreciate any advice on solving this error.

推荐答案

我通过对insecure_private_key文件的路径进行了硬编码来替换了insecure_private_key的路径,从而解决了该问题.

I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.

所以它来自:

config.ssh.private_key_path = [
    customKey,
    "#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]

收件人:

config.ssh.private_key_path = [
    customKey,
    "C:/Users/My.User/.vagrant.d/insecure_private_key"
]

这篇关于如何解决Vagrant错误:`private_key_path`文件必须存在:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆