Vagrant + VirtualBox + Ubuntu = no internet access?
If you use Vagrant and Ubuntu VMs with VirtualBox provider, could happen that you don't have internet connection inside the VM and this leads to the pain in one place when you want to install some software or so...
If you strugle with it, add those lines to the Vagrantfile and your life will be better :)
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
Written by Ignas Butėnas
Related protips
10 Responses
I think you just saved me a whole bunch of debugging. With this "fix" it seems that the Ubuntu VM is a LOT faster when resolving domains. My VM had internet connection, but DNS resolving was kind of slow.
@thasmo glad it helped :)
Any other neat "Vagrant + VirtualBox + Ubuntu" tricks? :D
Thanks! Saved a lot of struggle
Worked for me, thanks.
Thank you!!!
didn't helped
command- ping google.com
giving no output
What exactly causes the loss of connectivity?
works !!! , don't forget you need to vagrant halt
the vm, vagrant suspend
is not enough
Thanks you.