Ubuntu – How to fix name service for Vagrant client

12.10vagrantvirtualbox-networking

I am new to Ubuntu (having just installed Ubuntu 12.10) and want to start developing with it. So I have installed Vagrant, downloaded lucid64.box, initialized, started it up and accessed it via ssh.

To the test the Internet connection on my client I've done ping google.com
and received unknown host: google.com. (Host got ping of course.)

Searching the web only got me to this solution which suggested to remove Vagrant and Virtual box, and re-install them, just make sure Vagrant installed first. I've tried this solution and I am still getting the same results.

What else can I try to get it to work?

Best Answer

I had the same issue with Ubuntu 12.10 and found a solution. Just add those lines to your Vagrantfile:

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

For Vagrant 1.1+ you will need (thanks to farooqsadiq)

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

It seems to be a known bug in VirtualBox on Ubuntu 12.10:

https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1048783

https://www.virtualbox.org/ticket/10864