n2y79g
Last Updated: September 02, 2016
·
8.996K
· butenas_com
Profile

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
Say Thanks
Respond

10 Responses
Add your response

5488
Avatar

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.

over 1 year ago ·
5490
Profile

@thasmo glad it helped :)

over 1 year ago ·
5491
Avatar

Any other neat "Vagrant + VirtualBox + Ubuntu" tricks? :D

over 1 year ago ·
11242
12f9fd89c73932bf3b8ce7c52fdc3c84

Thanks! Saved a lot of struggle

over 1 year ago ·
14730
8dd52344dc3eadd09fd030c51214b3ae

Worked for me, thanks.

over 1 year ago ·
15923
17a27d13d2195b4d6d273eb18c96d3a1

Thank you!!!

over 1 year ago ·
17426
0 y9lkkkxjponckbmbpzk7k cpper3klhbyn5fk1zci7xr7z0crrtyoptu xk01ndugzpmwnfufmqt

didn't helped
command- ping google.com
giving no output

over 1 year ago ·
18936
None

What exactly causes the loss of connectivity?

over 1 year ago ·
21296
C2713a4959692f16d27d2553fb06cc4b

works !!! , don't forget you need to vagrant halt the vm, vagrant suspend is not enough

over 1 year ago ·
28126

Thanks you.

over 1 year ago ·
Filed Under