首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将USB设备转发到虚拟盒的问题

将USB设备转发到虚拟盒的问题
EN

Ask Ubuntu用户
提问于 2012-07-14 21:26:21
回答 4查看 16.1K关注 0票数 3

我想连接一个CAN到USB接口来编程一个引擎控制单元到一个WinXP虚拟机。只有此设备不在vm窗口左下角的小USB图标下列出。

运行usb设备我得到以下信息:

代码语言:javascript
复制
T:  Bus=06 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=00 MxPS=16 #Cfgs=  1
P:  Vendor=0000 ProdID=0102 Rev=01.00
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 4 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none)

我的VM与所有其他usb设备(包括一些不寻常的设备)一起工作。在我的系统上不能工作的设备在Mac上的virtualbox和我学院的笔记本电脑的BSD上运行得很好。

我正在运行Ubuntu12.04和virtualbox 4.1.18

提前谢谢,这样我的工作就容易多了,不必总是开机赢了。

更多信息:

当我插入有问题的设备时,会发生这样的情况:

代码语言:javascript
复制
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[13416.745162] remove   /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13416.745212] remove   /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
KERNEL[13416.745236] remove   /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
KERNEL[13416.745265] remove   /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
KERNEL[13416.745287] remove   /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
KERNEL[13416.745309] remove   /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
KERNEL[13416.745330] remove   /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
KERNEL[13416.745352] remove   /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.745782] remove   /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
UDEV  [13416.747609] remove   /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
UDEV  [13416.747653] remove   /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
UDEV  [13416.747680] remove   /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
UDEV  [13416.747705] remove   /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
UDEV  [13416.748618] remove   /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
UDEV  [13416.748830] remove   /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.749363] remove   /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
KERNEL[13416.750026] add      /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13416.750062] add      /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
KERNEL[13416.750086] add      /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
KERNEL[13416.750115] add      /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
UDEV  [13416.751381] add      /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
UDEV  [13416.751417] add      /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
UDEV  [13416.751443] add      /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
UDEV  [13416.751898] add      /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13416.753027] add      /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
KERNEL[13416.753050] add      /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
KERNEL[13416.753064] add      /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
KERNEL[13416.753077] add      /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
KERNEL[13416.753091] remove   /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13416.753105] remove   /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
KERNEL[13416.753118] remove   /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
KERNEL[13416.753132] remove   /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
KERNEL[13416.753145] remove   /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
KERNEL[13416.753158] remove   /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
KERNEL[13416.753171] remove   /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
KERNEL[13416.753184] remove   /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
KERNEL[13416.755131] add      /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
UDEV  [13416.755158] remove   /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
KERNEL[13416.755174] add      /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
UDEV  [13416.755189] add      /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
KERNEL[13416.755203] add      /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
UDEV  [13416.755218] remove   /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
KERNEL[13416.755231] add      /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
UDEV  [13416.755245] add      /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
UDEV  [13416.755260] add      /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.755275] add      /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
UDEV  [13416.755289] remove   /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
UDEV  [13416.755303] remove   /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13416.755622] add      /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
KERNEL[13416.755643] add      /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
KERNEL[13416.755656] add      /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
KERNEL[13416.755670] add      /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.759319] add      /devices/system/cpu/cpu0/cpuidle/state2 (cpu)
UDEV  [13416.759348] add      /devices/system/cpu/cpu0/cpuidle/state3 (cpu)
UDEV  [13416.759364] remove   /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
UDEV  [13416.759379] remove   /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
UDEV  [13416.759394] add      /devices/system/cpu/cpu1/cpuidle/state1 (cpu)
UDEV  [13416.759409] add      /devices/system/cpu/cpu1/cpuidle/state0 (cpu)
UDEV  [13416.759424] remove   /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.759439] add      /devices/system/cpu/cpu1/cpuidle/state3 (cpu)
UDEV  [13416.759453] remove   /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
UDEV  [13416.759468] add      /devices/system/cpu/cpu1/cpuidle/state2 (cpu)
UDEV  [13416.759482] add      /devices/system/cpu/cpu0/cpuidle/state1 (cpu)
UDEV  [13416.759496] add      /devices/system/cpu/cpu0/cpuidle/state0 (cpu)
KERNEL[13417.205442] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[13417.208418] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [13417.227113] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [13417.229757] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)

如果插入正确转发的矢量设备,会发生这样的情况:

代码语言:javascript
复制
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[13696.085406] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-2 (usb)
KERNEL[13696.465828] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0 (usb)
UDEV  [13696.484915] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-2 (usb)
UDEV  [13696.492091] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0 (usb)

lsusb的产出:

代码语言:javascript
复制
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 17ef:1004 Lenovo Integrated Webcam
Bus 004 Device 002: ID 08ff:2810 AuthenTec, Inc. AES2810
Bus 004 Device 003: ID 0a5c:2145 Broadcom Corp. Bluetooth with Enhanced Data Rate II
Bus 006 Device 007: ID 0000:0102  
Bus 002 Device 011: ID 1248:1001 

-f /var/log/kern.log包括连接和连接设备:

代码语言:javascript
复制
tp@tp-ThinkPad-R500:~$ tail -f /var/log/kern.log
Jul 15 10:46:53 tp-ThinkPad-R500 kernel: [15135.583561] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
Jul 15 10:46:53 tp-ThinkPad-R500 kernel: [15135.632544] ADDRCONF(NETDEV_UP): wlan0: link is not ready
Jul 15 10:46:53 tp-ThinkPad-R500 kernel: [15135.633620] tg3 0000:04:00.0: irq 49 for MSI/MSI-X
Jul 15 10:46:53 tp-ThinkPad-R500 kernel: [15135.662314] ADDRCONF(NETDEV_UP): eth0: link is not ready
Jul 15 10:46:55 tp-ThinkPad-R500 kernel: [15137.314088] tg3 0000:04:00.0: eth0: Link is up at 100 Mbps, full duplex
Jul 15 10:46:55 tp-ThinkPad-R500 kernel: [15137.314093] tg3 0000:04:00.0: eth0: Flow control is on for TX and on for RX
Jul 15 10:46:55 tp-ThinkPad-R500 kernel: [15137.315407] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Jul 15 10:46:56 tp-ThinkPad-R500 kernel: [15138.477486] input: Logitech Bluetooth Mouse M555b as /devices/pci0000:00/0000:00:1a.1/usb4/4-2/4-2:1.0/bluetooth/hci0/hci0:11/input14
Jul 15 10:46:56 tp-ThinkPad-R500 kernel: [15138.477699] generic-bluetooth 0005:046D:B009.0002: input,hidraw0: BLUETOOTH HID v4.16 Mouse [Logitech Bluetooth Mouse M555b] on 00:24:2C:BF:81:72
Jul 15 10:47:05 tp-ThinkPad-R500 kernel: [15148.080037] eth0: no IPv6 routers present
Jul 15 10:52:03 tp-ThinkPad-R500 kernel: [15445.116070] usb 6-1: new full-speed USB device number 8 using uhci_hcd
Jul 15 10:52:16 tp-ThinkPad-R500 kernel: [15458.488118] usb 6-1: USB disconnect, device number 8
EN

回答 4

Ask Ubuntu用户

发布于 2014-04-21 16:53:41

这可能是Ubuntu中VB usb支持的一个问题。

安装USB2.0支持,正如在https://www.virtualbox.org/wiki/Downloads之前所说的

但是,然后将用户添加到vboxuser组https://help.ubuntu.com/community/VirtualBox/USB

在vboxuser中,对USB没有特权是VB中的一个常见问题。

代码语言:javascript
复制
sudo adduser yourusername vboxusers

可悲的是,在添加到需要注销和登录的组后,然后再试一次,VB应该识别列表中的USB。

(在上一个版本中,甚至不需要添加过滤器,只需打开正在运行的VM上的"USB设备“菜单,并选择设备并插入到客户端机器上)

票数 2
EN

Ask Ubuntu用户

发布于 2012-07-14 21:29:44

您必须安装virtualbox extension pack

https://www.virtualbox.org/wiki/Downloads

您还需要安装guest additions,以便为您的virtualbox客户端获得适当的驱动程序。

票数 1
EN

Ask Ubuntu用户

发布于 2012-07-14 22:21:29

有些USB设备可能无法正常使用Virtual。这可能是与您的CAN到USB接口,但它是值得一试,如果我们让虚拟盒访问它。

为此,我们可以尝试在计算机的USB设置中添加“空”USB过滤器:

这可能已经有助于识别您的设备。我们还可以尝试在右键单击"New 1“以打开设置窗口时进一步指定USB属性,并为每个条目提供一些说明性工具提示:

也请阅读虚拟盒手册,了解这些设置的说明以及如何获得它们。

票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/163611

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档