免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6725 | 回复: 4
打印 上一主题 下一主题

freebsd 下 qemu 如何加载usb设备 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-19 18:26 |只看该作者 |倒序浏览
在bsd下装了个xp 想用U盾,
bsd下已经发现了这个东西。。

www# usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub0
port 1 powered
port 2 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub1
port 1 powered
port 2 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub2
port 1 powered
port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub3
port 1 addr 2: full speed, power 150 mA, config 1, product 0x8005(0x8005), vendor 0x155b(0x155b), rev 12.02
   uhid0
port 2 powered
Controller /dev/usb4:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), Intel(0x0000), rev 1.00
  uhub4
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
port 7 powered
port 8 powered

就是那个usb3

可是启动qemu时 加参数 -usb -usbdevice host:155b:8005 时出现

Warning: could not add USB device host:155b:8005

论坛徽章:
0
2 [报告]
发表于 2008-10-20 11:27 |只看该作者
顶一下。。。

论坛徽章:
0
3 [报告]
发表于 2008-10-21 09:14 |只看该作者
好像是没有解决方案。。。。。

论坛徽章:
0
4 [报告]
发表于 2010-01-11 15:38 |只看该作者
--enable-alsa

to the configure command.
The scripts in the final section of this Wiki page show you how to setup your environment so that you can actually hear the sound that QEMU outputs. The requirement for sound to come from your speakers is the environment variable QEMU_AUDIO_DRV which must have a value of either “sdl” or “oss“, or in case you compiled-in ALSA support, it may have a value of “alsa” as well.

Using an USB device in QEMU

USB devices that are connected to the host machine can be accessed directly inside the Virtual Machine. QEMU needs an aditional parameter -usb to actually enable USB support in the VM. The emulated Intel SB82371 UHCI-Controller has a 8-port USB hub. If you want access to one of your physical devices, you will need to find out it’s Vendor-ID and Product-ID. This information is obtained by examining the output of

/sbin/lsusb

or

cat /proc/bus/usb/devices

. You can either tell QEMU to make the device available by looking up the VendorID and ProductID and passing it on the commandline

qemu -usb -usbdevice host:<VendorID>:<ProductID> <other_parameters>

or starting QEMU just with USB support enabled:

qemu -usb <other_parameters>

After booting the guest OS in the VM, switch to the monitor by pressing Ctrl+Alt+2 and enter the following command

usb_add host:<VendorID>:<ProductID>

When you return to the graphical screen of the Guest by pressing Ctrl+Alt+1 you will see a USB “device attach” event in the messagelog (Linux) or on-screen (Windows).

    * An example: You have a HP Scanjet 3300C connected to the USB port of your computer. The output of lsusb is

      # lsusb
      Bus 003 Device 002: ID 03f0:0205 ScanJet 3300C

      The command that you use to make this scanner accessible in QEMU is

      qemu -usb -usbdevice host:03f0:0205 <other_parameters>

The important thing to consider with using real USB devices, is that the Host must not have any driver loaded for the USB device. If your hotplug loads drivers automatically, you can enter the driver’s name into the file /etc/hostplug/blacklist to make sure that hotplug will leave it alone. In the QEMU dccumentation I noticed that this is supposedly no longer an issue with (recent) 2.6 kernels. YMMV as I have not yet tried this.

论坛徽章:
0
5 [报告]
发表于 2010-01-11 15:51 |只看该作者
你母系统的U盾要不加载模块
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP