*(FYI: originally I've posted this question to stack overflow 
<http://stackoverflow.com/q/28323953/9157>, not realizing this group is the 
better forum for it)*

I have a problem with networking while setting up a development virtual 
machine

The host environment is:

   - Windows 7x64
   - Vagrant 1.7.2
   - Virtualbox 4.3.20 r96997
   - has an active WLAN internet connections
   - can connect to a VPN

The relevant sections from the Vagrantfile are:

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.define 'devbox' do |node|
    node.vm.network :private_network, ip: '192.168.56.2'
  end
end

With this, the guest machine has two network interfaces:

   - eth0: NAT
   - eth1: the private network

After a vagrant up the machine is always accessible through the private IP. 
However, if at boot time the VPN connection

   - is active, then the guest machine cannot access the internet
   - is not active, then the guest machine can access the internet

On the host machine, with an active VPN connection, both public and 
VPN-restricted hosts are accessible.

adding

config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

solves the internet connectivity issue, however, it brings the boot time of 
the guest machine to barely tolerable (many minutes)

*Question*: how should I modify the Vagrantfile to ensure that the guest 
machine always has internet access, regardless whether it was booted with 
an active VPN connection on the host machine or not?

Thanks,

Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to