Xilinx / qemu

Xilinx's fork of Quick EMUlator (QEMU) with improved support and modelling for the Xilinx platforms.
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/821395464/QEMU+User+Documentation
Other
231 stars 150 forks source link

petalinux qemu booting error #43

Closed aditya-singhal closed 4 years ago

aditya-singhal commented 4 years ago

I am using xilinx-zcu102-v2020.1-final.bsp version of petalinux package. I am trying to configure tap networking backend on the pre-built images. I have created a network bridge and tap interface successfully on my host machine. This is my command to boot up qemu: petalinux-boot --qemu --prebuilt 3 --qemu-args "-netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no.

The linux successfully boots-up, but it has not picked up network configuration settings. when I do ifconfig on the guest machine, it still has 10.0.2.15 ip address. Then, I change the ip address manually. But still I am not able to ping and get ssh working for my guest machine.

aditya-singhal commented 4 years ago

There is a error in petalinux-boot command. My command is: $ petalinux-boot --qemu --prebuilt 3 --qemu-args "-netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no

-netdev argument was getting passed 2 times:

  1. -netdev user,id=eth0 and then
  2. -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no (as per the --qemu-args).

petalinux-boot internally calls qemu-system-aarch64 command and passes the -netdev user,id=eth0 argument by default irrespective of what we have passed in --qemu-args. As a result, the network was getting configured in the user mode and I was getting the ip address as 10.0.2.15. To solve this, I launched qemu manually using qemu-system-aarch64 command and passed all the required arguments and it worked.