当我尝试在 VirtualBox 中使用 USB 设备时,是什么阻碍了它?

当我尝试在 VirtualBox 中使用 USB 设备时,是什么阻碍了它?

Ubuntu 主机,XP 客户机。

当我将我想要的 USB 设备连接到虚拟机时,我得到:

无法将 USB 设备 Microchip Technology Inc. PICDEM FS USB Demo Board (C) 2004 连接到虚拟机 DevelXP。无法为 USB 设备创建代理设备。(错误:VERR_READ_ERROR)。结果代码:NS_ERROR_FAILURE (0x80004005) 组件:控制台接口:IConsole {8ab7c520-2442-4b66-8d74-4ff1e195d2b6}

$ lsusb
Bus 002 Device 029: ID 04d8:000c Microchip Technology, Inc. 

$ cat /etc/udev/rules.d/90-picdem.rules 
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000c", GROUP="plugdev", MODE="660"

(我也尝试过没有这个文件,没有变化)

$ grep dargaud /etc/group:
plugdev:x:46:dargaud
vboxusers:x:124:dargaud

$ dmesg
[103413.447464] usb 2-1.3: new full-speed USB device number 29 using ehci-pci
[103413.549055] usb 2-1.3: New USB device found, idVendor=04d8, idProduct=000c
[103413.549063] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[103413.549068] usb 2-1.3: Product: PICDEM FS USB Demo Board (C) 2004
[103413.549072] usb 2-1.3: Manufacturer: Microchip Technology Inc.

$ VBoxManage list usbhost
Host USB Devices:
UUID:               fbd0bac3-f283-46bc-9632-603471a932cb
VendorId:           0x04d8 (04D8)
ProductId:          0x000c (000C)
Revision:           0.0 (0000)
Port:               2
USB version/speed:  2/1
Manufacturer:       Microchip Technology Inc.
Product:            PICDEM FS USB Demo Board (C) 2004
Address:            sysfs:/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3//device:/dev/vboxusb/002/029
Current State:      Held

为什么会被阻止?是什么阻止了它?注意:其他自定义 USB 卡工作正常。不过这个卡比较旧,所以可能是 USB1/1.1/2 的问题?我在虚拟机中暂时禁用了 USB 2.0 EHCI,但没有变化。

更多信息:

$ sudo udevadm info -q path -n /dev/bus/usb/002/029
/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3

$ sudo udevadm info -a -p /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3                      

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3':
    KERNEL=="2-1.3"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{bDeviceSubClass}=="00"
    ATTR{bDeviceProtocol}=="00"
    ATTR{devpath}=="1.3"
    ATTR{idVendor}=="04d8"
    ATTR{speed}=="12"
    ATTR{bNumInterfaces}==" 1"
    ATTR{bConfigurationValue}=="1"
    ATTR{bMaxPacketSize0}=="8"
    ATTR{busnum}=="2"
    ATTR{devnum}=="29"
    ATTR{configuration}==""
    ATTR{bMaxPower}=="100mA"
    ATTR{authorized}=="1"
    ATTR{bmAttributes}=="80"
    ATTR{bNumConfigurations}=="1"
    ATTR{maxchild}=="0"
    ATTR{bcdDevice}=="0000"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{quirks}=="0x8"
    ATTR{version}==" 2.00"
    ATTR{urbnum}=="18"
    ATTR{ltm_capable}=="no"
    ATTR{manufacturer}=="Microchip Technology Inc."
    ATTR{removable}=="removable"
    ATTR{idProduct}=="000c"
    ATTR{bDeviceClass}=="00"
    ATTR{product}=="PICDEM FS USB Demo Board (C) 2004"

  looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1':
    KERNELS=="2-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{devpath}=="1"
    ATTRS{idVendor}=="8087"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="2"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="0mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="8"
    ATTRS{bcdDevice}=="0000"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="660"
    ATTRS{ltm_capable}=="no"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0020"
    ATTRS{bDeviceClass}=="09"

  looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="0"
    ATTRS{idVendor}=="1d6b"
    ATTRS{speed}=="480"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{authorized_default}=="1"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="0mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="3"
    ATTRS{bcdDevice}=="0313"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="0000:00:1d.0"
    ATTRS{version}==" 2.00"
    ATTRS{urbnum}=="26"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 3.13.0-29-generic ehci_hcd"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0002"
    ATTRS{bDeviceClass}=="09"
    ATTRS{product}=="EHCI Host Controller"

  looking at parent device '/devices/pci0000:00/0000:00:1d.0':
    KERNELS=="0000:00:1d.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci-pci"
    ATTRS{irq}=="17"
    ATTRS{subsystem_vendor}=="0x1028"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x0c0320"
    ATTRS{companion}==""
    ATTRS{enabled}=="1"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
    ATTRS{device}=="0x3b34"
    ATTRS{uframe_periodic_max}=="100"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-3"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x040a"
    ATTRS{numa_node}=="-1"
    ATTRS{d3cold_allowed}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""


$ VBoxManage showvminfo DevelXP --details  
Name:            DevelXP
Groups:          /
Guest OS:        Windows XP (32 bit)
UUID:            79b38fbb-d0d5-4b78-9ee4-944050e4b4b8
Config file:     /home/dargaud/.VirtualBox/Machines/DevelXP/DevelXP.vbox
Snapshot folder: /home/dargaud/.VirtualBox/Machines/DevelXP/Snapshots
Log folder:      /home/dargaud/.VirtualBox/Machines/DevelXP/Logs
Hardware UUID:   79b38fbb-d0d5-4b78-9ee4-944050e4b4b8
Memory size:     2048MB
Page Fusion:     off
VRAM size:       64MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  2
PAE:             off
Long Mode:       on
Synthetic CPU:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             local time
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
State:           running (since 2014-06-17T12:43:14.761000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: on
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE Controller
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
IDE Controller (0, 0): /home/dargaud/.VirtualBox/HardDisks/XP.vdi (UUID: 93969496-17bb-46c2-9e56-a7c24b6e05f4)
IDE Controller (1, 0): Empty
NIC 1:           MAC: 080027A62FA1, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: ALSA, Controller: AC97)
Clipboard Mode:  Bidirectional
Drag'n'drop Mode: disabled
Session type:    GUI/Qt
Video mode:      1680x1050x32 at 0,0
VRDE:            disabled
USB:             enabled
EHCI:            enabled

USB Device Filters:

Index:            0
Active:           no
Name:             JMicron USB to ATA/ATAPI bridge [0100]
VendorId:         152d
ProductId:        2338
Revision:         0100
Manufacturer:     JMicron
Product:          USB to ATA/ATAPI bridge
Remote:           0
Serial Number:    43527262060A

Index:            1
Active:           yes
Name:             Cypress
VendorId:         04b4
ProductId:        8613
Revision:         
Manufacturer:     
Product:          
Remote:           0
Serial Number:    

Index:            2
Active:           no
Name:             Broadcom Corp 5880 [0101]
VendorId:         0a5c
ProductId:        5800
Revision:         0101
Manufacturer:     Broadcom Corp
Product:          5880
Remote:           0
Serial Number:    0123456789ABCD

Index:            3
Active:           yes
Name:             Microchip Technology Inc. PICDEM FS USB Demo Board (C) 2004
VendorId:         04d8
ProductId:        000c
Revision:         0000
Manufacturer:     Microchip Technology Inc.
Product:          PICDEM FS USB Demo Board (C) 2004
Remote:           
Serial Number:    

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  

Name: 'dargaud', Host path: '/home/dargaud' (machine mapping), writable
Name: 'lpscdata', Host path: '/informatique/dargaud' (machine mapping), writable
Name: 'D620', Host path: '/D620' (machine mapping), writable
Name: 'tmp', Host path: '/tmp' (machine mapping), writable

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /home/dargaud/.VirtualBox/Machines/DevelXP/DevelXP.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             WindowsXP
Additions run level:                 3
Additions version:                   4.2.18 r88780


Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2014/06/17 12:43:25 UTC)
Facility "VirtualBox System Service": active/running (last update: 2014/06/17 12:44:01 UTC)
Facility "VirtualBox Desktop Integration": active/running (last update: 2014/06/17 12:44:23 UTC)
Facility "Seamless Mode": active/running (last update: 2014/06/17 12:43:25 UTC)
Facility "Graphics Mode": active/running (last update: 2014/06/17 12:43:25 UTC)

答案1

我在使用另一个 USB 设备(Garmin 运动手表)时也遇到了类似的问题。

这是我的配置:

  • 主持人:Ubuntu 14.04 上的 VirtualBox 5.0.0 r101573,安装了 Oracle VM VirtualBox 扩展包
  • 客人:Windows 7,安装了 VirtualBox Guest Additions

无论我在 VM 设置中选择哪个 USB 控制器,每当我启动 VM 时都会收到错误:

无法为 USB 设备创建代理设备。(错误:VERR_READ_ERROR)。

结果代码:NS_ERROR_FAILURE (0x80004005) 组件:ConsoleWrap 接口:IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

经过一些研究,我得出结论这很可能是一个臭名昭著的 VirtualBox 漏洞,目前仍处于开放状态(准确地说,是重新打开的缺陷)。请参见VirtualBox 票号 #5175了解详情。这与设备的当前状态有关,设备处于某种状态Held(可以通过运行命令进行检查,VBoxManage list usbhost正如您所做的那样)。

相关内容