身份验证失败.重试..在Vagrantfile中使用自定义创建的框



我使用以下命令打包虚拟机,

vagrant package --base VMID —-output builder.box

我的流浪者档案如下所示,

box = "centos/7"
prefix_ip_addr = "174.10.10."
Vagrant.configure("2") do |config|
config.vm.box = box 
builder_ip = "%s100" % [prefix_ip_addr]
config.ssh.forward_agent = true
config.ssh.insert_key = false
config.vm.define :builder do |builder|
# Setup builder VM and IP
builder.vm.hostname = "builder"
builder.vm.network :private_network, ip: builder_ip
# Setup builder VM system requirements
builder.vm.provider "virtualbox" do |v| 
v.memory = 1024 * 16
v.cpus = 8 
v.customize ["modifyvm", :id, "--natdnshostresolver1","on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end 
end 
end

然后我使用创建的盒子来启动另一台机器,那个 Vagrantfile 如下所示,

Vagrant.configure("2") do |config|
config.ssh.forward_agent = true
config.vm.define :builder1 do |builder|
builder.vm.box = "package.box"
end 
end

但是我收到此错误,

builder1: Warning: Authentication failure. Retrying...
builder1: Warning: Authentication failure. Retrying...
builder1: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This         means that
Vagrant was unable to communicate with the guest     machine within
the configured ("config.vm.boot_timeout" value) time     period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

请帮助我被这个错误困了很长时间了。 :(

我知道这已经很老了,但我自己刚从流浪者开始就遇到了这个问题。 对于那些可能也在这里的人,我只是在我的流浪者文件中添加了以下内容:

config.vm.boot_timeout = 60

对于操作,我可能还会检查您是否还需要设置 config.ssh.username 和 config.ssh.password 指令。

最新更新