We use vagrant to install the VirtualBox image with Ubuntu Linux. It has a private network, and several ports are forwarded - here are some snippets from our Vagrantfile:
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.network "forwarded_port", guest: 3306, host: 3306 #mysql
...
config.vm.network "forwarded_port", guest: 8098, host: 8098 #riak http
config.vm.network "forwarded_port", guest: 8087, host: 8087 #riak pb
This works when starting a virtual machine.
But after the host computer is suspended for a while (a shorter period) and resumes, port forwarding no longer works.
Everything responds perfectly to the allocated address of the private network 192.168.33.10, but not to localhostwhere the attempt simply hangs.
Any ideas for a solution?
Specifications:
Host OS: Mac OS X, version 10.9 "Mavericks"
Guest OS: Ubuntu 12.04, precise64 (standard box from vagrantup.com)
Vagrant 1.4.0
VirtualBox version: VirtualBox 4.3.4 r91027
Virtual Box > Machine Settings > Network
Adapter 1:
Attached to: NAT
Cable Connected : True
Port Forwarding:
TCP, HostIP=, HostPort=3306, GuestIP=, GuestPort=3306
TCP, HostIP=, HostPort=8098, GuestIP=, GuestPort=8098
TCP, HostIP=, HostPort=8087, GuestIP=, GuestPort=8087
TCP, HostIP=127.0.0.1, HostPort=2222, GuestIP=, GuestPort=22
I found a similar question but cannot use the same answer: VirtualBox port forwarding does not work with NAT adapter