I try to use network in guest system. I installed an OS in a virtual machine, but I did not get the network configured. When I try to ping, for instance google.com I get the IP address for the domain, but packets are not transmitted. I tried several guest OS's, but behavior is the same for them, so I suspect that something is wrong with either the qemu itself or with host OS.
I tried both kvm and qemu-system-i386 to run the guest system. Nothing changed.
Pinging from the host system works. Like other network facilities.
Here are some parameters of my host system:
$ kvm -version QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-6+b1), Copyright (c) 2003-2008 Fabrice Bellard $ uname -a Linux debian 3.14-1-amd64 #1 SMP Debian 3.14.12-1 (2014-07-11) x86_64 GNU/Linux
How pinging looks like:
$ ping google.com PING google.com (22.214.171.124): 56 data bytes ^C --- google.com ping statistics --- 44 packets transmitted, 0 packets received, 100.0% packet loss
Additionally, I noticed that port forwarding works. I can connect to the guest via ssh, if I start it as follows:
kvm -m 512 -net nic,model=rtl8139 -net user,hostfwd=tcp::5555-:22 -drive cache=writeback,index=0,media=disk,file=hd0.img &