流浪汉期间我收到此错误
There are errors in the configuration of this machine. Please fix
the following errors and try again:
SSH:
* `private_key_path` file must exist: insecure_key
Run Code Online (Sandbox Code Playgroud)
如何设置私钥以便使用vagrant ssh?我正在使用Windows 7.
我的流浪文件
Vagrant.configure("2") do |config|
config.vm.define "phusion" do |v|
v.vm.provider "docker" do |d|
d.cmd = ["/sbin/my_init", "--enable-insecure-key"]
d.image = "phusion/baseimage"
d.name = 'dockerizedvm'
d.has_ssh = true
#d.force_host_vm = true
end
v.ssh.port = 22
v.ssh.username = 'root'
v.ssh.private_key_path = 'insecure_key'
v.vm.provision "shell", inline: "echo hello"
#v.vm.synced_folder "./keys", "/vagrant"
end
end
Run Code Online (Sandbox Code Playgroud)
所以在我的情况下,我使用cygwin与windows,我收到:
* `private_key_path` file must exist:
C:\cygwin64\home\basic.user/.vagrant.d/insecure_private_key
Run Code Online (Sandbox Code Playgroud)
经过几分钟的调查后,我意识到VAGRANT_HOME环境变量不正常,因此导出正确的环境变量完成了这项工作:
VAGRANT_HOME=/cygdrive/c/Users/basic.user
export VAGRANT_HOME
Run Code Online (Sandbox Code Playgroud)