如何将通用USB外设从macOS X主机传递到VirtualBox中的Ubuntu 16.04 x64 guest虚拟机?

时间:2018-11-28 03:58:10

标签: macos usb virtual-machine virtualbox

我可以在macOS主机上执行此操作,以在命令行上查看USB设备

ioreg -p IOUSB
+-o Root  <class IORegistryEntry, id 0x100000100, retain 21>
  +-o AppleUSBVHCIBCE Root Hub Simulation@80000000  <class AppleUSBRootHubDevice, id 0x1000004c7, registered, matched, active, busy 0 (0 ms), retain 18>
  | +-o iBridge FaceTime HD Camera (Built-in)@80200000  <class AppleUSBDevice, id 0x1000004c9, registered, matched, active, busy 0 (4 ms), retain 18>
  | +-o iBridge ALS@80300000  <class AppleUSBDevice, id 0x1000004ce, registered, matched, active, busy 0 (2 ms), retain 11>
  | +-o Headset@80400000  <class AppleUSBDevice, id 0x1000004d2, registered, matched, active, busy 0 (3 ms), retain 14>
  | +-o iBridge@80100000  <class AppleUSBDevice, id 0x1000004d6, registered, matched, active, busy 0 (3 ms), retain 13>
  | +-o iBridge Display@80600000  <class AppleUSBDevice, id 0x1000004ed, registered, matched, active, busy 0 (2 ms), retain 15>
  | +-o iBridge DFR brightness@80700000  <class AppleUSBDevice, id 0x1000004f1, registered, matched, active, busy 0 (1 ms), retain 11>
  | +-o Apple Internal Keyboard / Trackpad@80500000  <class AppleUSBDevice, id 0x100001fbf, registered, matched, active, busy 0 (11 ms), retain 22>
  +-o AppleUSBXHCI Root Hub Simulation@14000000  <class AppleUSBRootHubDevice, id 0x100000511, registered, matched, active, busy 0 (0 ms), retain 9>
  | +-o USB2.0 Hub             @14300000  <class AppleUSBDevice, id 0x100000cac, registered, matched, active, busy 0 (2 ms), retain 16>
  |   +-o USB 2.0 Hub@14340000  <class AppleUSBDevice, id 0x100000ce0, registered, matched, active, busy 0 (2 ms), retain 18>
  |   | +-o USB Optical Mouse@14343000  <class AppleUSBDevice, id 0x100000d0e, registered, matched, active, busy 0 (4 ms), retain 14>
  |   | +-o USB Keyboard@14344000  <class AppleUSBDevice, id 0x100000d23, registered, matched, active, busy 0 (5 ms), retain 16>
  |   | +-o PCAN-USB@14341000  <class AppleUSBDevice, id 0x100002f33, registered, matched, active, busy 0 (1 ms), retain 14>
  |   | +-o PCAN-USB@14342000  <class AppleUSBDevice, id 0x100002f7a, registered, matched, active, busy 0 (1 ms), retain 14>
  |   +-o Flash Disk      @14330000  <class AppleUSBDevice, id 0x100002f8e, registered, matched, active, busy 0 (1 ms), retain 14>
  +-o AppleUSBXHCI Root Hub Simulation@00000000  <class AppleUSBRootHubDevice, id 0x100000cc4, registered, matched, active, busy 0 (1 ms), retain 9>
    +-o USB3.0 Hub             @00100000  <class AppleUSBDevice, id 0x100000cc8, registered, matched, active, busy 0 (2 ms), retain 15>
      +-o Plugable UD-3900@00110000  <class AppleUSBDevice, id 0x10000159d, registered, matched, active, busy 0 (24 ms), retain 31>

现在...假设我要使用闪存磁盘或PCAN-USB之类的设备,然后直接将其传递给我的Ubuntu 16.04 x64 VirtualBox VM?

我已经完成了一些工作,以便在macOSX主机(Mohave 10.14.1)上安装VirtualBox扩展包

https://askubuntu.com/questions/25596/how-to-set-up-usb-for-virtualbox

安装完这些东西后,我将VM上的总线设置为USB 2.0,然后尝试使其检测到主机上插入的USB设备,但到目前为止还算不上成功。

我在VirtualBox USB设置中注意到我可以做一个过滤器...我可以以某种方式通过USB设备吗?如果是这样,我不知道如何基于macOS主机正确设置过滤器。看起来就是这样。

filter

有没有人能够手动设置从macOS主机传递到VirtualBox中的Linux VM的USB设备?任何帮助表示赞赏!

1 个答案:

答案 0 :(得分:1)

我想得太多了……事实证明,在安装VirtualBox和VB扩展包后,我只需要重新启动计算机即可。

重新启动主机,然后从VirtualBox中的冷启动启动我的VM之后,我现在看到了所有USB设备!

对于任何对如何获取USB过滤器设置的USB信息感到好奇的人,似乎此命令提供了正确的输出:

system_profiler SPUSBDataType

示例输出:

PCAN-USB:

              Product ID: 0x000c
              Vendor ID: 0x0c72
              Version: 54.ff
              Speed: Up to 12 Mb/sec
              Manufacturer: PEAK-System Technik GmbH
              Location ID: 0x14342000 / 36
              Current Available (mA): 500
              Current Required (mA): 200
              Extra Operating Current (mA): 0

PCAN-USB:

              Product ID: 0x000c
              Vendor ID: 0x0c72
              Version: 54.ff
              Speed: Up to 12 Mb/sec
              Manufacturer: PEAK-System Technik GmbH
              Location ID: 0x14341000 / 35
              Current Available (mA): 500
              Current Required (mA): 200
              Extra Operating Current (mA): 0