arm raspi2/raspi3 emulation has no USB support

Bug #1772165 reported by George on 2018-05-19
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Using Qemu 2.12.0 on ArchLinux.

Trying to emulate arm device with `qemu-system-arm` and attach usb device for unput using

` -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002 `

# lsusb returns

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 014: ID 13d3:3487 IMC Networks
Bus 001 Device 004: ID 0457:11af Silicon Integrated Systems Corp.
Bus 001 Device 003: ID 0bda:57e6 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

# qemu returns
qemu-system-arm: -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002: Bus '001' not found

Tried with connecting external usb keyboard but that didn't seem to work either.

Peter Maydell (pmaydell) wrote :

Can you give the full QEMU command line you're using? (I suspect the reason for this error is that the board model you're using does not have a USB controller.)

George (vortelf) wrote :

qemu-system-arm -M raspi2 -append "rw earlyprintk loglevel=8 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2" -cpu arm1176 -dtb bcm2709-rpi-2-b.dtb -hda DietPi_v6.8_RPi-ARMv6-Stretch.img -kernel kernel7.img -m 1G -smp 4 -serial stdio -usb -device usb-host,bus=001,vendorid=0x1d6b,productid=0x0002

tags: added: usb
Peter Maydell (pmaydell) wrote :

Thanks. The USB controller for the raspi2/raspi3 boards is not currently modelled, so it's expected that USB devices won't work.

George (vortelf) wrote :

How then should I be able to actually use the vm when there is no input?

Peter Maydell (pmaydell) wrote :

Serial terminal is how I've used the raspi3 board before.

George (vortelf) wrote :

Serial terminal doesn't work with this options. Would you provide options with which i'll be able to access and login into the terminal. SSH is also a good solution.

Peter Maydell (pmaydell) wrote :

This is for raspi3 but may be a useful reference:

Probably what you're hitting is that the kernel/dtb default to the second serial terminal, so you can try adding 'console=ttyAMA0' to the -append options, or alternatively maybe using -serial null -serial stdio to drop the 1st serial output and send the second to the terminal.

Since the raspi networking sits behind USB, QEMU doesn't support that, so no ssh option, I'm afraid.

George (vortelf) wrote :

Whenever I append `console=ttyAMA0` I get kernel panic `Division by zero in kernel` and -serial stdio doen't seem to work.

Gerd Hoffmann (kraxel-redhat) wrote :

Beside rpi3 usb emulation not being there you are using the wrong argument. bus= specifies the *guest* bus. hostbus= can be used to specify the host bus number. When passing through devices using vendorid and productid this should not be needed though. Oh, and you can't pass through usb hubs, only individual devices.

Peter Maydell (pmaydell) on 2018-06-01
tags: added: arm
summary: - qemu-system-arm: -device usb-
- host,bus=001,vendorid=0x04f2,productid=0x0111: Bus '001' not found
+ arm raspi2/raspi3 emulation has no USB support
Peter Maydell (pmaydell) on 2018-07-06
Changed in qemu:
importance: Undecided → Wishlist
status: New → Confirmed
mcandre (andrew-pennebaker) wrote :

Out of curiousity, does the raspi2 machine support a PCI bus? I am trying to boot Debian arm64 with qemu-system-aarch64, and am running into all manner of complaints from qemu about missing devices. Is there another machine like virt, but that offers support for boot devices?

On Sun, 24 Mar 2019 at 17:34, mcandre <email address hidden> wrote:
> Out of curiousity, does the raspi2 machine support a PCI bus?

No. There is no PCI bus on the raspi2 hardware and so there
is no PCI bus in QEMU's model of it.

> I am
> trying to boot Debian arm64 with qemu-system-aarch64, and am running
> into all manner of complaints from qemu about missing devices. Is there
> another machine like virt, but that offers support for boot devices?

I'm not sure what you mean by "boot devices" here. "virt" is
generally the machine we would recommend if you just want to
boot Debian. If you haven't seen this blog post before it might
be of use:

-- PMM

After reading change logs, I believe USB support for raspi2/raspi3 is not added yet. Which means host internet network can't be accessed by emulated machine.

I would be glad to help in documentation of differences between real Raspberry Pi devices and QEMU emulated raspi2/raspi3 since I have seen a lot of tutorials on internet trying to use QEMU for emulating raspberry pi. These tutorials most of the times are just hacks, like using versatilepb or using custom kernel instead of the Raspbian OS.

I have gathered as much info as possible over the last week through these tutorials, QEMU raspi code and change logs, and believe a good documentation of this info could help future users trying to emulate raspi.

Finally, I am able to run latest Raspbian OS (2019-07-10) lite version on raspi2 using the following command where I have extracted kernel image and dtb file from second partition:

qemu-system-arm -M raspi2 -kernel bootpart/kernel7l.img -dtb bootpart/bcm2709-rpi-2-b.dtb -drive file=2019-07-10-raspbian-buster-lite.img,format=raw,if=sd -append "rw console=ttyAMA0 loglevel=8 root=/dev/mmcblk0p2 rootwait memtest=1" -serial stdio

I am not able to connect network devices, not able to use images other than lite image ( and unsure why this command is showing Hardware name as BCM2835 when the QEMU raspi code has BCM2836 associated with raspi2 (

I highly appreciate the support provided for raspi2 and raspi3 till now.

Thank you.

Peter Maydell (pmaydell) wrote :

I think the two main things we would need would be:
 (1) a proper data sheet for the pi2/pi3 USB controller. Last time I looked there wasn't one available; it's pretty hard to model the controller properly without it. (Perhaps one has been released since I last looked.)
 (2) somebody who cares about the pi2/pi3 models and has the time to invest in writing a device model for them

Weber Kai (weberkai) wrote :


I've googled: "usb" "designware" "otg" "datasheet"

I think this is the kernel driver for this device:

Maybe it should be possible to use this as a reference? Maybe try to redirect the proprietary drivers system calls? I don't know...

I've also found theses docs, which explains the device a little bit:


Peter Maydell (pmaydell) wrote :

Thanks for digging those up. Unfortunately just the driver sources aren't really enough information for a good device model, and the other docs are just overviews without the level of detail we need.

Clement Deschamps (clemd) wrote :

It looks like a similar USB controller is part of a TI SoC:


Davide Bacilieri (davbac) wrote :

Right now with
`qemu-system-arm -kernel kernel7.img -dtb bcm2709-rpi-2-b.dtb -cpu arm1176 -M raspi2 -hda 2018-11-13-raspbian-stretch-full.img`
I can access the serial console using `Ctrl+Alt+3` in the QEMU window.
Using raspbian via this serial console is (as far as I can see) the same as using the Lite version.
The main display doesn't accept any mouse/ keyboard input, and `-device usb-mouse` generates a `qemu-system-arm: -device usb-mouse: No 'usb-bus' bus found for device 'usb-mouse` error, even after the `-machine usb=on` command

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers