I have a Debian 8 guest VirtualBox (4.3.26_Ubuntur98988) VM running on Ubuntu 15.04, managed by Vagrant 1.7.4. Whenever the host system suspends it is unable to ping the guest or connect to it over port 80 (there may be others, though these are the ones I have noticed)
Port 22 seems to still be accessible, since SSH is unaffected (until running
/etc/init.d/networking restart on the guest, at which point the
[....] Restarting networking (via systemctl): networking.service is printed before the connection is seemingly lost. Further attempts to connect via
vagrant ssh hang).
I have tried restarting both the networking and network-manager services on the host after resuming with no effect. Disabling NAT in my Vagrantfile was also unsuccessful.
Switching the private network to use DHCP instead of a static IP address did allow the connection to persist over the suspension, but this is inconvenient because I use an entry in my hosts file to allow my use of a mysite.dev style hostname which my application needs to work correctly. This issue wasn’t really a problem before I switched to Debian (I had been using Ubuntu Server 14.04 previously) and is not an issue on my MacBook at all.
The relevant parts of my Vagrantfile:
VAGRANTFILE_API_VERSION = '2' IP = '192.168.10.10' CPUS = 2 MEMORY = 2048 VM_NAME = 'vagrant' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.network :private_network, ip: IP # config.vm.network :private_network, type: 'dhcp' # "works" config.vm.provider 'virtualbox' do |vb| vb.name = VM_NAME vb.customize ['modifyvm', :id, '--memory', MEMORY] vb.customize ['modifyvm', :id, '--cpus', CPUS] vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on'] vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] vb.customize ['modifyvm', :id, '--ostype', 'Debian_64'] end config.vm.network 'forwarded_port', guest: 80, host: 8000 config.vm.network 'forwarded_port', guest: 443, host: 44300 end