如何将下载的.box文件添加到Vagrant的可用框列表中?该.box文件位于外部驱动器上.
我尝试过运行vagrant box add my-box d:/path/to/box,但Vagrant将路径解释为URL.
我有一个3个VM的集群.这是Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = {
"host0" => "192.168.33.10",
"host1" => "192.168.33.11",
"host2" => "192.168.33.12"
}
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.ssh.private_key_path = File.expand_path('~/.vagrant.d/insecure_private_key')
hosts.each do |name, ip|
config.vm.define name do |machine|
machine.vm.hostname = "%s.example.org" % name
machine.vm.network :private_network, ip: ip
machine.vm.provider "virtualbox" do |v|
v.name = name
# #v.customize ["modifyvm", :id, "--memory", 200]
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
这曾经工作,直到我最近升级:
ssh -i ~/.vagrant.d/insecure_private_key vagrant@192.168.33.10
Run Code Online (Sandbox Code Playgroud)
相反,vagrant要求输入密码.
似乎最近版本的vagrant(我在1.7.2上)为每台机器创建了一个安全的私钥.我通过跑步发现了它
vagrant ssh-config
Run Code Online (Sandbox Code Playgroud)
输出显示每个主机的不同密钥.我通过区分它们来验证键是不同的. …