I'm trying to set up a vagrant. Host is Ubuntu 12.10. Here's my vagrant file:
Vagrant::Config.run do |config|
config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true)
config.vm.network :bridged, :bridge => "eth0"
config.vm.define "restserver" do |chefs_config|
chefs_config.vm.box = "precise64"
chefs_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
chefs_config.vm.host_name = "restserver"
chefs_config.vm.network :hostonly, "192.168.20.50"
chefs_config.vm.forward_port 80, 8080
config.vm.provision :chef_solo do |chef|
chef.log_level = :debug
chef.cookbooks_path = "cookbooks"
chef.run_list.clear
chef.add_recipe "apt"
chef.add_recipe "base"
chef.add_recipe "mongodb::default"
chef.add_recipe "nginx"
end
end
end
The problem is that my internet access from within the vagrant is terrible. It's very slow. I think the routing tables might be messed up. Here's the output from route -n
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 10.0.2.2 0.0.0.0 UG 100 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
There are 2 routes to the default destination, although on the same NIC and to the same gateway. But perhaps this is causing an issue. At least that's what I thought but deleting the first default route doesn't help.
I need host-only networking so the nfs share will work. NAT is used for the port forwarding, and I've added the bridged network to try to give this guest access to the internet.
Has anyone any idea what's wrong? DNS is very slow to resolve, and it's slow to download anything from the internet.