Search code examples
linuxqemubuildroot

Can't ping linux image running on Qemu


I am very new to this but i used build root to built kernel for arm-versatilepb then i am using qemu to run it with the following command: qemu-system-arm -M versatilepb -m 256 -kernel zImage -dtb versatile-pb.dtb -drive file=rootfs.ext2,if=scsi,format=raw -append "root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user

when i run the image from qemu and do the ifconfig :#ifconfig eth0 Link encap:Ethernet HWaddr 52:54:00:12:34:56
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0

so the problem is i can ping any site i try from my qemu machine but when i try to ping the qemu machine(with ip :10.0.2.15) from my host machine it is not responding thanks in advance


Solution

  • The answer to your question is the same as the answer to this one: How to connect KVM guest vm from mac hosts by ssh?

    You're using user-mode networking, which doesn't allow the outside world to connect in to the guest, except if you set up specific port forwarding on your QEMU command line.