This is my Vagrantfile.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"config.vm.hostname = "myapp.dev"
config.vm.network :forwarded_port, guest: 9000, host: 9000, auto_correct: true
config.vm.network :forwarded_port, guest: 8983, host: 8983, auto_correct: true
config.vm.synced_folder "salt/roots/", "/srv/"
config.vm.provision :salt do |salt|salt.minion_config = "salt/minion" salt.run_highstate = true salt.install-type = "daily" salt.verbose = true
end
config.vm.provider :virtualbox do |v|v.customize ["modifyvm", :id, "--memory", 1024]
end
end
From inside the vagrant machine, curl -L localhost:9000|wc
returns a lot of words, lines and whatnot, and the answer is a HTTP proper response.
From outside the vagrant machine, curl -L localhost:9000|wc
returns 0 lines (and the others), and curl -L localhost:9000
returns the message Connection reset by peer
.
The service iptables is running neither in my local machine, nor in my virtual machine.
the services that are running in my virtual vagrant machine are
The services running on my local machine are
If any more info is required, i'll supply it.
[EDIT] I've also tried netcat-ing
on the virtual machine:
$ nc -l 8978
on the local machine
>$ nc localhost 8978
>$
At this point the connection initiated from the local machine to the virtual machine is closed, but the virtual machine keeps listening)
HOWEVER, when i start listening with nc -l 65530
on the local machine, and connect to it with nc 65530
, i can send packets.
Got it:
VirtualBox was caussing the issue:
Apparently i had another box started up, which was also listening on port 9000. When i started up my box, i received a message that instead of forwarding from 9000 -> 9000, it was forwarding from 2201 -> 9000. I simply turned off the other box.
This was happening because of the auto_correct
parameter set in the Vagrantfile.