如何修复Vagrant错误:`private_key_path`文件必须存在:

Mr *_*r B 6 ssh vagrant puphpet vagrantfile vagrant-windows

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

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

C:\ xx>流浪汉

使用"virtualbox"提供程序将计算机"默认"启动...此计算机的配置存在错误.请修正以下错误,然后重试:

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

我遇到了这个问题,并将insecure_private_key从puphpet\files\dot\ssh移动到Vagrantfile所在的目录.但是这会产生同样的错误.

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

病人://.vagrant.d/insecure_private_key

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

我的Vagrantfile可以在这里找到.

感谢有关解决此错误的任何建议.

Mr *_*r B 7

我通过硬编码insecure_private_key文件的路径来替换insecure_private_key的路径来解决问题.

所以它来自:

config.ssh.private_key_path = [
    customKey,
    "#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
Run Code Online (Sandbox Code Playgroud)

至:

config.ssh.private_key_path = [
    customKey,
    "C:/Users/My.User/.vagrant.d/insecure_private_key"
]
Run Code Online (Sandbox Code Playgroud)


小智 6

它看起来像是因为你可能已经执行了一个删除了insecure_private_key.

但是,vagrant文​​件会查找puphpet\files\dot\ssh files,如果它们在那里,它会查找insecure_private_key.

delete (rename)中的id_rsa文件puphpet\files\dot\ssh

这为我修好了!