近日遇到Vagrant安装VirtualBox 的CentOS镜像初始化失败问题。
环境:
windows7 x64 ,vagrant 1.9.5,oracle vm virtualbox5.1.18
从官方源添加的box:
vagrant box add generic/centos7 --provider=virtualbox
过程:设置好Vagrantfile(是从之前用过的box配置文件复制过来的):
Vagrant.configure("2") do |config|
config.vm.define "Docker" do |dk|
dk.vm.box = "CentOS-7" #"generic/centos7"
dk.ssh.username="root"
dk.ssh.insert_key = 'true'
dk.vm.box_check_update = false
dk.vm.boot_timeout = 60
dk.vm.network "private_network", ip:"192.168.33.12"
#default by vagrant ,disabled
dk.vm.synced_folder ".", "/vagrant", disabled: true
dk.vm.synced_folder "e:/javawd/dockerwd", "/dockerwd"
dk.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "512"
vb.name = "Docker"
vb.cpus = 2
end
config.vm.provision "hello", type: "shell" do |s|
s.inline = "echo hello Docker user"
end
end
end
Vagrant up 启动,到SSH连接虚拟机阶段时出错,出错现象:
Docker: Waiting for machine to boot. This may take a few minutes...
Docker: SSH address: 127.0.0.1:2222
Docker: SSH username: root
Docker: SSH auth method: private key
Docker: Warning: Connection aborted. Retrying...
Docker: Warning: Authentication failure. Retrying...
Docker: Warning: Authentication failure. Retrying...
Docker: Warning: Authentication failure. Retrying...
Docker: Warning: Authentication failure. Retry