我正在尝试部署两个不同OS的4个无所事事的盒子。其中两个是Ubuntu,另外两个是Centos。我的游标文件配置如下:-
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.hostname="ubuntu"
ubuntu.vm.box="bento/ubuntu-17.10"
ubuntu.vm.network "private_network", ip:"192.168.33.10"
end
config.vm.define "centos" do |centos|
centos.vm.hostname="centos"
centos.vm.box="bento/centos-7.4"
centos.vm.network "private_network", ip:"192.168.33.20"
end
config.vm.define "server1" do |server1|
server1.vm.hostname="server1"
server1.vm.box="bento/ubuntu-17.10"
server1.vm.network "private_network", ip:"192.168.33.30"
end
config.vm.define "server2" do |server2|
server2.vm.hostname="server2"
server2.vm.box="bento/centos-7.4"
server2.vm.network "private_network", ip:"192.168.33.40"
end
成功执行vagrant up
后,我检查了vagrant status
,发现所有框都运行正常。
ubuntu running (virtualbox)
centos running (virtualbox)
server1 running (virtualbox)
server2 running (virtualbox)
但是,当我尝试使用vagrant ssh ubuntu
,vagrant ssh centos
,vagrant ssh server1
,vagrant ssh server2
命令登录到每台计算机时,除server1以外的所有计算机都可以登录。当我尝试使用vagrant ssh server1
访问server2时,该错误显示:-
"ssh_exchange_identification: read: Connection reset by peer"
我在基本OS Loki系统上使用流浪汉2.2.4。向经验丰富的TIA寻求帮助
答案 0 :(得分:0)
问题已解决。我真的没有错!但是,我尝试按照以下简单步骤操作,幸运的是它起作用了:1. vagrant destroy
2. vagrant up