1

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

migrated from serverfault.com Sep 10 '15 at 23:50

This question came from our site for system and network administrators.

  • What version of VirtualBox are you using? This all sounds like a problem with VirtualBox’s built in networking/routing. Bug reports like this on the official VirtualBox site seem similar to your issues. – JakeGould Sep 11 '15 at 0:09
  • I am running version 4.3.26_Ubuntur98988. For what it's worth, my vagrant is version 1.7.4 – Zac Crites Sep 11 '15 at 0:10
  • Well, my first suggestion is to upgrade VirtualBox to version 4.3.30 which is the latest version. Changelog for 4.3 versions can be found here. In my experience with VirtualBox networking quirks over the years, a patch level upgrade like jumping from 4.3.26 to 4.3.30 clears up some niggly issues like what you are facing. – JakeGould Sep 11 '15 at 0:15
  • I just upgraded to 5.0.4 and I am still having this issue. Could 4.3.30 have a patch that 5.0.4 wouldn't regarding this issue? – Zac Crites Sep 11 '15 at 0:22
  • Possibly. Generally you should assume that a new full number upgrade will be raw and have issues you can’t predict. There is a reason they are still supporting 4.3 iterations. – JakeGould Sep 11 '15 at 0:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.