VH not allowing me to see device when using PyUSB or python-libusb1

Hi,

I am trying to use PyUSB and/or python-libusb1 to communicate with a USB device on my local host (MacBook running 10.12 Sierra).

`lsusb` showed the devices ok (it's a bash script which filters the output of `System Information.app`)

however, the pyusb and python-libusb1 find examples do not detect my devices. It only detects the standard apple devices (presumably the hubs).

Looking at the output of `ioreg -l` I noticed that VH was matching against those devices, even when neither the VH client or server was running.

I then decided to unload the drivers.

`sudo kextunload /System/Library/Extensions/vhhcd.kext` failed to unload as it claims (libkern.kext) is in use or retained (cannot unload).

`sudo kextunload /System/Library/Extensions/vhusbd.kext` successfully unloaded.

I now can see the usb devices listed via pyusb and python-libusb1 find examples.

Surely I should be able to detect usb devices if VH is loaded (and the devices were not attached by VH).

So my questions are:

Why does VH prevent my usb devices from being detected via libusb1?

Is that expected?

Is it a VH issue or libusb1 issue?

Thanks, Brendan.

#2

Apple removed support for 3rd party usb host controllers like virtualhere in 10.11, because they re-wrote their entire USB subsystem in the kernel.

Apple have put back in temporary support for 3rd party host controller drivers like virtualhere's (due to a lot of complaints from companies like mine and others) .

In doing so i notice that devices shared by virtualhere dont appear in the system information USB dialog. And i notice that FTDI devices dont get detected via virtualhere in 10.12.2 or later but worked in 10.12.1. So they are doing something with their usb stack still (virtualhere hasnt changed since 10.10) so im hoping apple finally puts back official support for 3rd party host controllers soon, (but they never say what their plans are so i dont know) then it would probably all just work.

Anyway thats probably why its not being found. If you do ioreg you will see it but if you look in system information it wont be there. so i think this is related to your issue of libusb not finding the device when using the virtualhere client driver. (vhhcd.kext)

The virtualhere server is written a different way that doesn't use low-level host controller features so its compatible with all osx versions. I don't think you should run the server (vhusbd.kext) and client on the same machine. That could also be an issue.