USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
sam.li
Posts: 2
Joined: 22. Jan 2017, 08:16

USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by sam.li »

I'm attempting to set up USB passthrough for an Ubuntu LTS image that is set up for embedded development. I managed to get USB passthrough (using this image) to work on my desktop running Ubuntu 16.04LTS (after adding my user to the vboxusers group), but I can't for the life of me seem to get it to work on my MacBook.

Here's the output of
VBoxManage list usbhost
with the STLink plugged in.

Code: Select all

UUID:               f055d220-67a2-4c0e-b15b-aca612b7a983
VendorId:           0x05ac (05AC)
ProductId:          0x8290 (8290)
Revision:           1.64 (0164)
Port:               3
USB version/speed:  0/Full
Manufacturer:       Broadcom Corp.
Product:            Bluetooth USB Host Controller
Address:            p=0x8290;v=0x05ac;s=0x00000000c8ea82e5;l=0x14300000
Current State:      Available

UUID:               4fbb626e-52f5-456e-a86e-2431384f9494
VendorId:           0x05ac (05AC)
ProductId:          0x0274 (0274)
Revision:           6.36 (0636)
Port:               4
USB version/speed:  0/Full
Manufacturer:       Apple Inc.
Product:            Apple Internal Keyboard / Trackpad
SerialNumber:       D3H639626N1GHMFAV6RF
Address:            p=0x0274;v=0x05ac;s=0x000000008e081e1d;l=0x14400000
Current State:      Unavailable

UUID:               b37bb569-8b41-4293-97f2-22fb909fd24b
VendorId:           0x0483 (0483)
ProductId:          0x3748 (3748)
Revision:           1.0 (0100)
Port:               2
USB version/speed:  0/Full
Manufacturer:       STMicroelectronics
Product:            STM32 STLink
SerialNumber:       UÿopƒRH9g
Address:            p=0x3748;v=0x0483;s=0x0000004f575f4ff6;l=0x14200000
Current State:      Busy
And running
lsusb
on my Virtual Machine

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
I have a USB Filter enabled with the following fields

Code: Select all

Name: STLink
Vendor ID: 0483
Product ID: 3748
Remote: Any
And Enable USB controller is checked, with USB 2.0 (EHCI Controller) enabled. I'm running VirtualBox Version 5.1.14 r112924 (Qt5.6.2) and have Oracle VM VirtualBox Extension Pack 5.1.14r112924 installed.

Any help is greatly appreciated. My hunch is that all my USB ports are USB 3.0, and something about that is causing problems, seeing as I was able to get USB passthrough to work on my desktop using the same image and settings.
sam.li
Posts: 2
Joined: 22. Jan 2017, 08:16

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by sam.li »

I think I've managed to come up with a workaround.

So it seems like this is an issue with the latest version of VirtualBox. I was looking in the bug tracker this afternoon, and I came across this ticket, which prompted me to attempt a downgrade to VirtualBox 5.0.8. After downgrading VirtualBox and the extension pack, the STLink device is detected. So I believe there's some sort of regression between 5.0.8 and VirtualBox 5.1.14
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by mpack »

There is another workaround that someone just reminded me of in another thread.

viewtopic.php?f=2&t=56750#p362667
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by michaln »

It would be really useful if someone pinpointed between which revisions exactly the device stopped working. Or sent us one.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by mpack »

I'm not sure anything stopped working as such. I'm not sure if you're familiar with the ST-Link, but it's a JTAG like debug interface for embedded devices containing MCU's made by ST. I wouldn't really expect USB JTAG-alikes to work reliably from a VM, they're likely to be too fussy about timing. A paravirtual type solution ought to work better, and that's sort of what I believe the link I provided is about. Of course I'm using a very broad definition of "paravirtual": I simply mean simulating a physical interface using a hidden communition protocol.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by michaln »

Anything fussy about timing shouldn't be using USB in the first place... although not all designers of USB devices seem to be aware of that. But no, I've never seen a ST-Link device before, and I have no idea how they work on the USB level.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by mpack »

For debug and flash programming links USB is the only practical option these days, and I can assure you that they work far better than the old LPT dongles ever did.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: USB Passthrough on MacBook Pro (Retina, 2015) running macOS Sierra

Post by michaln »

At least to me, flash programming and debugging does not imply "fussy about timing". So yeah, of course it works better than parallel ports that no one has anymore :)

As for the original problem, I think it should be fixed, and it affected specific USB devices with "creative" names, ones including ASCII control characters to be specific. Not sure what they were thinking.
Post Reply