I am new to Vagrant and I encounter a problem when I tried to set up two VMs (in the same Vagrantfile). The Vagrantfile looks like:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.define "m2" do |m|
m.vm.network "private_network", ip: "192.168.1.101"
m.vm.provision "shell" do |shell|
shell.path = "2.sh"
end
end
config.vm.define "m3" do |m|
m.vm.network "forwarded_port", guest: 80, host: 9000
m.vm.network "private_network", ip: "192.168.1.102"
m.vm.provision "shell" do |shell|
shell.path = "3.sh"
end
end
I set up a PostgreSQL and an NFS server on the machine "m2". However, I cannot access to either of them on "m3". nmap shows that the ports 5432 (PostgreSQL) and 2049 (nfs) were both closed. I could ping and ssh "m2" from "m3".
I should have the correct PostgreSQL and nfs settings for ingoing connections. And I tried to set iptables but the problem was still there. Have anyone encountered the same problem? How did you solve it?
Many thanks.