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 '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: NATeth1: the private networkAfter 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.
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