Windows Guest VM no internet on Ubuntu KVM host

Cerin asked:

I installed Windows 7 as a guest in KVM running on Ubuntu 12. Windows seems to be running fine with the exception that it can’t access any external domains or IPs.

The guest can ping the host’s IP and the host can ping the guest’s IP, but that’s it.

I used the default NAT setup, which others have reported should work. What can I do to fix this?

Edit: I also have VirtualBox running on the same host, also running a Windows VM, and it’s internet works just fine.

Edit: The Ubuntu host’s routing table:

user@localhost:~$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth2
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth2
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 virbr0

The virbr0 is some old bridge leftover from when I tried setting up bridging in Virtualbox, but it’s no longer used since Virtualbox works find with NAT. I did try using it with KVM, but had no success.

My answer:


Is there some reason you can’t use bridged networking? I always run in bridged mode when the VMs need to have access to the Internet, and I generally recommend it (you haven’t given any reason why bridged mode might not be a good idea). The VMs are then treated as first-class citizens as far as network connectivity is concerned.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.