1

I would like to run a Internet-capable OpenWrt-Box on a Windows10 Machine using QEMU.

I have tried this command:

"c:\Program Files\qemu\qemu-system-aarch64.exe" -m 1024 -smp 2 -cpu cortex-a57 -M virt -nographic -kernel "c:\Program Files\qemu\images\openwrt-19.07.3-armvirt-64-Image-initramfs" -net nic -net nic -net user

and I can reach the root@OpenWrt:/# Shell. pinging 192.168.1.1 and 127.0.0.1 has 0% loss. But pinging 8.8.8.8 has 100% loss...

For a debian-Box on the same Windows-machine I run

"c:\Program Files\qemu\qemu-system-x86_64.exe" -hda "c:\Program Files\qemu\debian.qcow2" -smp cores=4 -m size=4096 -net nic,model=virtio -net user -vga virtio -boot strict=on

and I do have internet access.

I am using LAN.


I read this site:

https://openwrt.org/docs/guide-user/virtualization/qemu

and so far I can't find the way to do it...

Any hints? :)

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
scjorge
  • 111
  • 3

1 Answers1

0

Unprivileged users cannot use raw networking, therefore qemu cannot make ping work quite that easily.

It is an inherent limitation of -netdev user - if you want network functionality beyond tcp & udp, give your virtual machine the ability to send other types of packets e.g. create a virtual device and attach it via -netdev tap.

anx
  • 8,963
  • 5
  • 24
  • 48
  • oh... well, I tried ```-net root``` instead of ```-net user``` but it was unsuccessful. I also tried ```-netdev tap``` and I got ```c:\Program Files\qemu\qemu-system-aarch64.exe: -netdev tap: Parameter 'id' is missing```. any further hints? – scjorge Apr 23 '21 at 07:49