1

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

  • Does this answer your question? [How to connect KVM guest vm from mac hosts by ssh?](https://stackoverflow.com/questions/67135075/how-to-connect-kvm-guest-vm-from-mac-hosts-by-ssh) – Rob May 14 '21 at 18:50

2 Answers2

1

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.

Peter Maydell
  • 9,707
  • 1
  • 19
  • 25
0

The network configuration you are using (-net user) configures qemu to use a SLiRP network which does not support ICMP packets from the host machine into the qemu virtual NIC.

See https://wiki.qemu.org/Documentation/Networking#Network_backend_types, where it states that "in general, ICMP traffic does not work", and "the guest is not directly accessible from the host or the external network".

Tim Bird
  • 1,104
  • 9
  • 16