USB Devices unavailable/grayed-out due to permission problem

Discussions related to using VirtualBox on Mac OS X hosts.

USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 23. Oct 2009, 23:22

Hi folx,

for I've been asked by trac@VB.o to publish this here:

VirtualBox for OS-X seems to have the same permission problems described for Linux.
If I connect an USB drive, it appears as "unavailable" in VBoxManage or grayed-out in then guest-GUI dropdown menue, no matter what filter I define in the host settings.

Update 2009-11-26: The permission problem seems to be superseded. Search below for IOUSBMassStorageClass.


I found this beeing a permission problem. For a quick test, start VirtualBox.app as root.
If your USB device is not longer grayed-out, you may have the same problem.
BTW - this does not occur using an USB-Stick. Not tested with other devices. I guess, network devices (/dev/vboxnetctl) and disks (/dev/vboxdrv) are affected, other USB devices not.

Problem could be fixed by adding write-permissions to /dev/vboxdrv in the Host.
For details, see http://te.tl/vg

This appeared with: a seagate USB drive, OS-X 1.5.8, VirtualBox 3.0.8.
References: http://www.virtualbox.org/ticket/4168#comment:9
Last edited by Gnumpf on 26. Nov 2009, 21:22, edited 1 time in total.
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby ginopunsalan » 24. Oct 2009, 01:49

I too had usb problems, well due to my noob ignorance. While this may be unrelated to the issue described here, this may help other noobs like me.

To get a normally plug and play device to work:

1. Shut down the guest machine.

2. Highlight the guest machine in the VirtualBox panel.

3. Plug your usb device.

4. Click on blue USB category.

5. Click the green plus icon to add your device.

6. Your usb device should now be visible, click to add that.

7. Done.

Do this for each of your plug and play usb device. Start your guest machine and your usb device will be installed.
ginopunsalan
 
Posts: 13
Joined: 21. Oct 2009, 04:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7 RC

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 24. Oct 2009, 23:48

Gnumpf wrote:Problem could be fixed by adding write-permissions to /dev/vboxdrv in the Host.


Update: After updating my OS-X host (2009-005), the setup is broken again :-(
The /dev files are beeing rebuild with old permissions (600) during the reboot - but chown/chgrp or starting VB as root doesn't help any longer.
USB filter set in VB host settings, drive not mounted (but visible with 'diskutil list') in the host.

Can't say if this is a side-effect of my update, the reboot or just a new pitfall.
Any hints welcome.
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby ukchucktown » 25. Oct 2009, 17:42

Not tested and not recommended for anyone but expert users. The old hack does not work. The VB device file is reset to root:wheel on reboot. I'm also not sure the hack is needed on 10.6.1. I can plug in a USB device and the options are not grayed out in the VB settings but it never captures it so I really don't know. I'm still testing. So far, though, USB integration is not working for me on 10.6.1.

You can add your user account to the wheel group as a quick test. It gets you some other benefits like browsing system folders in Finder. BE CAREFUL, you can do some damage with wheel group privileges if you are sloppy. It's also probably not a good idea in a networked environment but at home is okay. With this hack you don't need the vboxusers group. The wheel group is the default group for root.

Open a terminal and from the command-line:

To add your account to the wheel group...
Code: Select all   Expand viewCollapse view
sudo dscl . merge /Groups/wheel users <your user name>


To remove your account from the wheel group...
Code: Select all   Expand viewCollapse view
sudo dscl . delete /Groups/wheel users <your user name>
ukchucktown
 
Posts: 43
Joined: 20. Mar 2009, 00:59
Location: Charleston, SC
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Kubuntu Karmic, Windows Server 2008

Re: USB Devices unavailable/grayed-out due to permission problem

Postby nodog » 28. Oct 2009, 15:02

I'm having this problem as well using a Mac OS X 10.6.1 (snow leopard) host, VirtualBox 3.0.8 and an Ubuntu 9.10 guest, but only with some USB devices. My Western Digital "My Passport Elite" and an old generic USB drive box with a drive in it both connect through USB just fine to my virtual machine. I can mount and umount the ext3 filesystems on them with no problems, but my Western Digital "My Passport Essential" refuses to be grabbed by the VirtualBox USB filters. I wish I had more information to give, but I don't so far.
nodog
 
Posts: 5
Joined: 28. Oct 2009, 14:40
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: ubuntu 9.10

Re: USB Devices unavailable/grayed-out due to permission problem

Postby ukchucktown » 29. Oct 2009, 00:41

Interesting a Western Digital is giving you grief. The one causing me problems is also a Western Digital. I have it in an enclosure but no luck the first time I tried with Kubuntu 9.10, 10.6.1 and 3.0.8.
ukchucktown
 
Posts: 43
Joined: 20. Mar 2009, 00:59
Location: Charleston, SC
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Kubuntu Karmic, Windows Server 2008

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 1. Nov 2009, 23:43

Some more debug output.

running a simple loop, then plugin the USB device:

Code: Select all   Expand viewCollapse view
while true
do
         echo ts=$(date "+%s")
         VBoxManage list usbhost | grep -A09 -B1 "VendorId:           0x0bc2"
done


shows:

Code: Select all   Expand viewCollapse view
ts=...0811
ts=...0811
ts=...0811 Current State: Available
ts=...0811 Current State: Available
...
ts=...0812 Current State: Available
ts=...0812 Current State: Available
ts=...0812 Current State: Unavailable
ts=...0812 Current State: Unavailable
ts=...0812 Current State: Unavailable


This occures with selecting "ignore" as well as with "eject" in the UserNotificationCenter popup.

/var/log/system.log does not show up any activity on OS-X side.

So something is "taking" the device before VirtualBox could access it? ... or is VB itself is taking the device and struggles? No idea so far...

Anybody here with similar problems to confirm this behaviour?
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 2. Nov 2009, 23:31

More details.
Today I tested two other USB drives.
One works, the other doesn't.

Code: Select all   Expand viewCollapse view
    VendorId:           0x04fc (04FC)
    ProductId:          0x0c05 (0C05)
    Revision:           16.3 (1603)
    Manufacturer:       Sunplus Technology Inc.
    Product:            USB to Parallel-ATA bridge
    SerialNumber:       ST9808210A            3*
    Address:            p=0x0c05;v=0x04fc;s=0x0000250c10a14b02;l=0xfd300000
    Current State:     Unavailable


Code: Select all   Expand viewCollapse view
    VendorId:           0x04fc (04FC)
    ProductId:          0x0c25 (0C25)
    Revision:           1.18 (0118)
    Manufacturer:       Sunplus Technology Co.,Ltd.
    Product:            USB to Serial-ATA bridge
    SerialNumber:       F*
    Address:            p=0x0c25;v=0x04fc;s=0x000025814d5d081c;l=0xfd300000
    Current State:      Captured


So both drives not working are from Seagate. This may indicate a driver issue at the host.

Just a small additional point: no improvement with VB 3.0.10.
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 26. Nov 2009, 21:57

Hi folx, new experiments, new news.

After a bunch of tests, the focus rests on OS-X. If OS-X does not release the drive, VirtualBox could not access ist. So unloading the OS-X USB driver seems to be the way to go. Matching USB device filters assumed.

My Seagate FreeAgent uses the kernel extension com.apple.iokit.IOUSBMassStorageClass. This could be determined by comparing the output of kextstat before and after plugging in the drive. Keep in mind, this only works the first time after booting, since the extension will stay loaded.
If somebody reading this knows a better way to show up which kernel-extension is used from a device, please drop me a note.

Below an example for unloading a kernel extension:
Code: Select all   Expand viewCollapse view
# be root to do this
kextunload -b com.apple.iokit.IOUSBMassStorageClass


Be kind and post a feedback, telling me/us if this worked for you as well.
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby nodog » 30. Nov 2009, 11:23

Gnumpf (and others),

Unfortunately, this didn't seem to work for me, because it doesn't appear that OS X is loading a driver specifically for my drive. I made a copy of the output of kextstat before and after plugging in my WD Passport USB external drive after a reboot, and the only driver which was in the "after" output that was not in the "before" output was the fuse.ext2 driver since the drive is formatted as ext2. Removing that driver probably wouldn't help as it's the filesystem driver and not the USB driver. I also use that driver to access a loopback storage file, so I actually can't remove it, anyway.

I do use other USB devices with no problem, but this one WD Passport just ain't sharing the love.
nodog
 
Posts: 5
Joined: 28. Oct 2009, 14:40
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: ubuntu 9.10

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Truck » 4. Dec 2009, 11:16

I run VirtualBox 3.1.0 on Slackware 13 64bit and had the problem with USB being grayed out for the XP guest.

Prior to this I had no problem with Slackware 12.2 and VirtualBox 3.0.10 - maybe the different startup etc.

Fix was to comment out the the usbf mount in rc.S

# Mount usbfs:
# if grep -wq usbfs /proc/filesystems; then
# if ! grep -wq usbfs /proc/mounts ; then
# if ! grep -wq usbfs /etc/fstab; then
# /sbin/mount -v usbfs /proc/bus/usb -t usbfs
# else
# /sbin/mount -v /proc/bus/usb
# fi
# fi
# fi

An the problem is fixed !!

VirtualBox seems to activate usbfs
Truck
 
Posts: 6
Joined: 2. Dec 2009, 23:04
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: XP

Re: USB Devices unavailable/grayed-out due to permission problem

Postby miudo23 » 4. Dec 2009, 11:44

Hi there,

could somebody tell me how to "start VirtualBox.app as root"????

thanks
miudo23
 
Posts: 2
Joined: 2. Dec 2009, 22:46
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: XP

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Toaster » 4. Dec 2009, 19:42

miudo23 wrote:Hi there,

could somebody tell me how to "start VirtualBox.app as root"????

thanks

This isn't a fix of the actual problem, only a work-around, but if you open Terminal, if you have already Virtual box running, you can do : ps -ef |grep Virtual and you will see where the program is located. So you can start it with root access with : sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox, and typing your usual password.
Toaster
 
Posts: 16
Joined: 6. Nov 2009, 15:10
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: OpenSolaris snv_127

Re: USB Devices unavailable/grayed-out due to permission problem

Postby Gnumpf » 6. Dec 2009, 00:04

Toaster wrote:
miudo23 wrote:Hi there,
could somebody tell me how to "start VirtualBox.app as root"????
thanks

... sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox, and typing your usual password.


or just type in your Terminal:
Code: Select all   Expand viewCollapse view
sudo open -a VirtualBox.app

As told above, my permission problems disappeared. I'm currently using the "kextunload" workaround and without altering the permissions of /dev/vboxdrv . Of course this is only possible as long as you don't need the affected usb kext for other devices at the same time.
Gnumpf
 
Posts: 11
Joined: 23. Oct 2009, 22:51
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Debian, CentOS

Re: USB Devices unavailable/grayed-out due to permission problem

Postby houfek » 7. Dec 2009, 22:20

Ok....more of the same.
Host: Mac 10.6.1
Guest: Windows 7 Ultimate 64 Bit
VB: 3.1.0

Every USB Device plugged in when guest is running shows "Device Not Recognized". Driver update shows correct driver installed. When USB device first installed, hovering over VB USB icon actually identifies the device correctly, but in another few seconds, I get the not recognized info. In VB settings, I have tried (1)installing all appropriate device filters, (2) no filters at all, (3) a "New Filter" which is supposed to make any USB device work, (4) using only the USB 1.0 checkbox, (5) using only the USB 2.0 checkbox, (6) using both 1.0 and 2.0 boxes checked......and all possible combos of those. I have tried inserting USB with only host running, then starting guest, ejecting the USB device in the host.....some say it then comes up in the guest....but I get the same result as indicated above. All of the devices are immediately recognized on the host side.

Can someone please help me ? This is driving me nuts !!

Thanks in advance !!

Jim
houfek
 
Posts: 6
Joined: 6. Dec 2009, 14:37
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Windows 7

Next

Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 12 guests