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 ( 56 data bytes
--- 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 &

If you using User-mode-networking in qemu any ICMP protocols (such as ping) will not work.

Verify whether you are connected to the internet with:

curl www.google.com

or equivalent.


qemu-system-arm.exe -M versatilepb -cpu arm1176 -hda 2012-07-15-wheezy-raspbian.img -kernel kernel-qemu -m 192 -append "root=/dev/sda2" -redir tcp:2222::22

i use the redir flag for internet acces on my Raspbian emulation with Qemu, have you tried it?

  • 1
    You probably misunderstood my question. Port redirection works, I can login to the guest system through ssh. But I can't use internet from the guest system. – mcsim Jul 24 '14 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.