qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Raspberry Pi emulation and network devices


From: Tom Cook
Subject: [Qemu-devel] Raspberry Pi emulation and network devices
Date: Wed, 07 Sep 2016 13:09:04 +0000

I'm trying to emulate a raspberry pi in QEMU using the fork at
https://github.com/0xabu/qemu.  I've cloned that code, then merged more
recent changes from https://github.com/qemu/qemu (as of sometime
yesterday) and fixed up the resulting build failures.  The guest is running
Linux kernel 4.1.13-v7+ #826 SMP PREEMPT.  The host is Ubuntu 16.04.

So far everything works except the network.  When I add `-usb -device
usb-net,netdev=net1 -netdev user,id=net1`, I get a recognized USB network
device in the guest:

$ lsusb
Bus 001 Device 005: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB
Ethernet/RNDIS Gadget

But it has no connectivity.  DHCP fails and it gets an autoconfiguration
address (ie 169.254.223.15 or similar).  Assigning a static IP address
(such as 10.0.2.20) doesn't help either:

$ ifconfig eth0 10.0.2.20
$ route add -net 0.0.0.0 gw 10.0.2.2
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
0.0.0.0         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0
$ wget http://10.0.2.2/
--2015-11-22 07:31:57--  http://10.0.2.2/
Connecting to 10.0.2.2:80... failed: No route to host.

As far as I can tell, the device driver loads correctly; relevant bits of
dmesg:

[    8.876789] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
[    8.996534] usb 1-1.3: New USB device found, idVendor=0525,
idProduct=a4a2
[    8.997284] usb 1-1.3: New USB device strings: Mfr=1, Product=2,
SerialNumber=10
[    9.024864] usb 1-1.3: Product: RNDIS/QEMU USB Network Device
[    9.025452] usb 1-1.3: Manufacturer: QEMU
[    9.025808] usb 1-1.3: SerialNumber: 1-1.3

[   50.934914] cdc_ether 1-1.3:1.0 eth0: register 'cdc_ether' at
usb-3f980000.usb-1.3, CDC Ethernet Device, 40:54:00:12:34:57
[   50.980186] usbcore: registered new interface driver cdc_ether
[   51.075190] usbcore: registered new interface driver cdc_subset

The only slightly weird thing is that QEMU occasionally spits these out:

usbnet: failed control transaction: request 0x2143 value 0xe index 0x0
length 0x0

A few of these appear at the end of boot, and they can be reliably
reproduced with `ifdown eth0` and `ifup eth0`.

I'm happy to spend some time getting this working or fixing the usb network
emulation to work in this case, but I'd be grateful if someone could give
me some pointers on where to start looking.  So far I'm not sure if it's a
QEMU problem or a guest driver problem.

Thanks,
Tom


reply via email to

[Prev in Thread] Current Thread [Next in Thread]