zsepi
zsepi

Reputation: 1662

vagrant provisioned virtualbox cannot access the internet when booted up with an active VPN connection on the windows 7 host

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

The host environment is:

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 'crm' do |node|
    node.vm.network :private_network, ip: '192.168.56.2'
  end
end

With this, the guest machine has two network interfaces:

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

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

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?

Update: 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)

Upvotes: 2

Views: 7247

Answers (1)

mamadou jallow
mamadou jallow

Reputation: 411

ok. i had the same problem but i am using windows. i did fix it. what i did is that opened virtualbox.

  1. go to settings

  2. select network

  3. change second adapter

  4. select under " attached to: " ' Host-only Adapter'

  5. under name. i selected " virtualbox host-only ethernet apdapter " do not select the name that have numbers at the end of the name example : #1, #2 and so on.

  6. i went to my device manager and delete all the virtual network drivers "not your physical network drivers". again this was in windows 8.

  7. i restart my pc

  8. confirm my chance have applied

  9. i vagrant up on my project directory and it was working

Upvotes: 2

Related Questions