No USB devices available

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
ecce
Posts: 1
Joined: 22. Mar 2020, 14:07

No USB devices available

Post by ecce »

Hi,

just did a fresh install of MacOS (Catelina, 10.15.3) and installed Virtualbox 6.1.4 r136177 along with the USB extension. However I cannot attach any USB device to a Windows VM. There is simply no device in the list to select.

I have tried restarting everything, reconnected devices, unmounted them from the host and so on. No device ever show up in the list on the host (The menu Devices > USB says "No USB devices connected")

I cannot upload images since I have not been member long enough, but this installation is as vanilla as it gets. A Windows 7 VM on MacOS, with the Vbox drivers installed, and thats it. The USB controller is enabled, I can change between USB 1, 2 and 3, the filter and add buttons are available - I just cant find a device to add. There are no filters configured.

The account I use to run VirtualBox is an administrator account. I also tried exporting the VM, starting VirtualBox as root and imported it there to see if that made any diff. It did not. The USB devices work fine on the host.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No USB devices available

Post by scottgus1 »

USB 2 & 3 require the Extension Pack. Do you have the EP installed in Virtualbox?

Not being a Mac guru, I don't know if this is necessary. But I recall that MacOS may be a descendant of Linux, and for Linux hosts:
the manual wrote:On supported Linux hosts, Oracle VM VirtualBox accesses USB devices through special files in the file system. When Oracle VM VirtualBox is installed, these are made available to all users in the vboxusers system group. In order to be able to access USB from guest systems, make sure that you are a member of this group.
Also see USB basics and troubleshooting
granada29
Volunteer
Posts: 687
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: No USB devices available

Post by granada29 »

scottgus1 wrote: Not being a Mac guru, I don't know if this is necessary. But I recall that MacOS may be a descendant of Linux, and for Linux hosts:
I'm sorry - that is bad advice. macOS is a descendant of FreeBSD and only loosely related to Linux by virtue of being a flavour of *nix. See https://en.wikipedia.org/wiki/XNU

In the early days Apple did investigate using a Linux based kernel (I think they called it Rhapsody) but decided to not go down that route.

The /dev/ tree in macOS is completely different in structure to Linux.
Flecke
Posts: 3
Joined: 26. Mar 2020, 11:51

Re: No USB devices available

Post by Flecke »

I have the same issue. Host is MacOS Catalina 10.15.3 on a Mac Pro.
I'm running VirtualBox 6.1.4 with corresponding extension pack.
There was no previous version of VirtualBox installed on this system.

When I try to add a USB device filter to a VM, the list is empty (showing <no devices available>).
On my host all USB devices are listed under USB of the hardware overview of the "System Information" tool.

It looks like VirtualBox does not have access to the USB devices. Is there any access control tool (besides the System Preferences->Security & Privacy stuff) that can be used to enable device access?
What else could be the reason?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: No USB devices available

Post by scottgus1 »

Good point, Granada29, I'm definitely no Mac guru... :oops: Do you by any chance use a USB device in a guest on a Mac host? (not being saucy in any way, I'd sincerely like to know) Is there a special account group that USB users need to be a part of or is that stuff strictly Linux only?

Flecke, that sparks a thought, I remember seeing something about how one might have to grant permissions to Virtualbox to use USB in some supervisory Mac app? (yeah, Granada, I know, this is probably horseradish, too... :lol: )
granada29
Volunteer
Posts: 687
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: No USB devices available

Post by granada29 »

I just tried this out - My host is running macOS 10.15.4, VirtualBox 6.1.4

I plugged in a USB GPS device, added it to the USB filter for a Win 10 VM and then started the VM.

I don't have any drivers installed for the GPS in the guest, but it does show up as "Prolific USB-to-Serial Comm Port (COM3)" in the 'Bluetooth & other devices' settings. I expect with appropriate software and a good sky-view that it would work.

I repeated this with a Linux (debian testing) VM and was also able to load the device with gpsd.

I have never had to add a new group to my macOS host, and I don't see any indication that the VirtualBox installer has done this.

I can't explain why this works for me - possibly because I have no host driver installed for the usb device.
Flecke
Posts: 3
Joined: 26. Mar 2020, 11:51

Re: No USB devices available

Post by Flecke »

I think I found the reason at least for my situation.
In my first post I didn't mention that I'm using the autostart functionality because I couldn't imagine that this could be related to the problem...
@ecce, are you also using auto start?

My setup is the following:
One VM is configured to start automatically when the host system is booting up.
For this setup I followed the installation instructions of the VirtualBox manual chapter 9.21.3. Mac OS X: Starting the Autostart Service With launchd.

In the VBoxSVC.log I can see the following line repeatedly:

Code: Select all

WARNING [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={16ced992-5fdc-4aba-aff5-6a39bbd7c38b} aComponent={HostWrap} aText={Could not load the Host USB Proxy service: VERR_GENERAL_FAILURE}, preserve=true  aResultDetail=0
When I do not use this launch daemon setup, USB devices are listed and can be added without a problem.
Any ideas?
Flecke
Posts: 3
Joined: 26. Mar 2020, 11:51

Re: No USB devices available

Post by Flecke »

After further investigation I could finally find the reason why it only occurs in a auto-start setup and also find an easy solution.

On MacOS the VirtualBox installer is already setting up a LaunchDaemon for loading several VirtualBox kernel extensions during system boot. One of the kernel extensions is responsible for the USB device handling in VirtualBox.
When I was configuring my auto-start VM I setup another LaunchDaemon for starting the VM (following the description of the manual).
I found out that these two LaunchDaemon scripts are launched concurrently by MacOS. One of them is loading the Kexts the other one is starting the VM.
This leads to the situation that the VirtualBox processes VBoxSVC and VBoxXPCOMIPCD, which are automatically launched for starting a VM, are running before all the necessary Kexts have been finished loading.
On my system the Kext files need about 6-8s for loading. For testing this I setup another LaunchDaemon which was just logging the status of the VBox kernel extensions in the system every second (using /usr/sbin/kextstat). VBoxSVC is launching much faster and is therefore unable to use any USB device plugged into the host.

As a solution I modified the auto-start LaunchDaemon script in a way that it waits until all the VBox kernel extensions have successfully been loaded before it is starting the VMs.

This is more or less a hack which shouldn't be necessary, I think.
In my opinion it should already be handled properly by VirtualBox itself.
Post Reply