Vagrant: Slow internet connection in guest

Solution 1:

Running Version 2 of the Vagrant config?

Sarah's provided the answer which is to use the NAT hosts DNS resolver as it's faster and will help speed things up.

However, in Version 2 of the vagrant config which is what most people are using now you'll have to do add following within your 'Vagrantfile' which will force the VM to uses NAT'd DNS:

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

You can tell if you're using v2 config if you have the following lines or something in the top of your Vagrantfile

VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

Solution 2:

Answer:

Add the following to the vagrant config:

config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]

See here for more: Vagrant / VirtualBox DNS 10.0.2.3 not working