我刚开始使用仿真器qemu,我正在尝试使用它来仿真raspbian系统,该系统用于raspberry pi,但我不知道如何在其中使用我的相机usb。有人能帮帮我吗?
发布于 2019-10-28 04:54:10
截至2019年10月,我们现在有了Qemu 4.1.0
,而goe's answer中的-usbdevice
是不推荐使用的。
因此,建议您使用新的选项-device usb...
,并且您的相机可能是high-speed
,所以您必须使用usb-ehci
,否则您将得到speed mismatch
错误。
也就是说,我从我的笔记本电脑上启动了一个带有集成网络摄像头的VM,其中包括:
qemu-system-x86_64 -enable-kvm -m 2048 -rtc base=localtime -hda /path/win7.img -cpu host -soundhw hda -usb -device usb-ehci,id=ehci -device usb-host,hostbus=1,hostaddr=3
hostbus=1,hostaddr=3
来自:
lsusb
...
Bus 001 Device 003: ID 0408:2fb1 Quanta Computer, Inc.
...
我是从以下几个方面了解到的:
sudo dmesg |grep -i webcam
...
[ 5594.955703] uvcvideo: Found UVC 1.00 device Laptop_Integrated_Webcam_2HDM (0408:2fb1)
...
发布于 2015-12-21 23:57:30
要包含usb设备,可以使用选项'-usbdevice‘并包含设备总线的位置。完整的选项可能类似于以下内容:
qemu-system-arm -M versatilepb ... -usbdevice host:5.4
主机地址定义(我指的是‘host:’后面的数字)可以用'lsusb‘命令找到。在'lsusb‘给出的列表中,你必须找到要共享的设备。例如:
$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 003: ID 046d:0805 Logitech, Inc. Webcam C300
Bus 005 Device 004: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 005 Device 002: ID 2109:3431
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
在前面的示例中,我想要共享的设备是'Logitech,Inc. HD Pro Webcam C920‘摄像头,正如您在相应的行中所看到的,总线和设备值在那里定义(分别为5和4)。
https://stackoverflow.com/questions/31617575
复制相似问题