I have no previous experience with VirtualBox but have been trying to use it for the last couple of weeks. Now I'm having what ought to be a simple problem, but I'm stuck. I can't get a VBox guest to see a connected USB flash drive.
Host: Fedora 16 Guest: Fedora 8 VirtualBox: 4.1.8 with (the only) extension
Host uses a USB keyboard and mouse which are attached normally during boot and are visible and useable by both the host and the guest. However, I'm usually running the guest headless. A VBox blank USB "filter" is installed. When connecting a flash drive, the host immediately reports detection but the guest does not see anything. These are the only USB devices anticipated. Host /var/log/messages extract:
Feb 18 20:37:04 sunvale kernel: [ 208.186078] usb 1-5: new high-speed USB device number 4 using ehci_hcd Feb 18 20:37:04 sunvale kernel: [ 208.304139] usb 1-5: New USB device found, id Vendor=0dd8, id Product=c100 Feb 18 20:37:04 sunvale kernel: [ 208.304148] usb 1-5: New USB device strings: Mfr=2, Product=1, SerialNumber=3 Feb 18 20:37:04 sunvale kernel: [ 208.304156] usb 1-5: Product: USB Flash Disk Feb 18 20:37:04 sunvale kernel: [ 208.304162] usb 1-5: Manufacturer: Netac Feb 18 20:37:04 sunvale kernel: [ 208.304167] usb 1-5: SerialNumber: 4880787365A536E3 Feb 18 20:37:04 sunvale kernel: [ 208.304980] scsi5 : usb-storage 1-5:1.0 Feb 18 20:37:04 sunvale mtp-probe: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:12.2/usb1/1-5" Feb 18 20:37:04 sunvale mtp-probe: bus: 1, device: 4 was not an MTP device Feb 18 20:37:05 sunvale kernel: [ 209.308678] scsi 5:0:0:0: Direct-Access Netac OnlyDisk 1.00 PQ: 0 ANSI: 2 Feb 18 20:37:05 sunvale kernel: [ 209.311032] sd 5:0:0:0: Attached scsi generic sg6 type 0 Feb 18 20:37:05 sunvale kernel: [ 209.649594] sd 5:0:0:0: [sdf] Assuming drive cache: write through Feb 18 20:37:05 sunvale kernel: [ 209.649602] sd 5:0:0:0: [sdf] Attached SCSI removable disk
There are no new lines added to /var/log/messages on the guest. (Yes, the flash drive referenced here is ancient. It is just a test device.) Further information:
# VBoxManage list usbhost Host USB Devices: ... UUID: c85d93b6-59a0-43b2-a347-e4f2d52dd924 VendorId: 0x0dd8 (0DD8) ProductId: 0xc100 (C100) Revision: 1.0 (0100) Manufacturer: Netac Product: USB Flash Disk SerialNumber: 4880787365A536E3 Address: sysfs:/sys/devices/pci0000:00/0000:00:12.2/usb1/1-5//device:/dev/vboxusb/001/0 04 Current State: Busy
The VBox manual seems to say that USB pass-through will not work if the USB device is actively used by the host. I presume this attachment constitutes active use, especially since it is reported as busy, but the drive is not mounted. (I have explicitly disabled auto-mount.) What do I need to do to let this device (and any other USB flash drives inserted) be seen by the guest?
Searching online finds only references to using auto-mount on the host, then sharing the mount directory with the guest. That is not an ideal solution in this case as software on the guest expects to mount the drive and would need to be extensively modified. Besides, I hate auto-mount.
The issue is the flash drive. What can't the guest see it?
On 02/22/2012 07:58 AM, Dave Close wrote:
I have no previous experience with VirtualBox but have been trying to use it for the last couple of weeks. Now I'm having what ought to be a simple problem, but I'm stuck. I can't get a VBox guest to see a connected USB flash drive.
Host: Fedora 16 Guest: Fedora 8 VirtualBox: 4.1.8 with (the only) extension
Host uses a USB keyboard and mouse which are attached normally during boot and are visible and useable by both the host and the guest. However, I'm usually running the guest headless. A VBox blank USB "filter" is installed. When connecting a flash drive, the host immediately reports detection but the guest does not see anything. These are the only USB devices anticipated. Host /var/log/messages extract:
Feb 18 20:37:04 sunvale kernel: [ 208.186078] usb 1-5: new high-speed USB device number 4 using ehci_hcd Feb 18 20:37:04 sunvale kernel: [ 208.304139] usb 1-5: New USB device found, id Vendor=0dd8, id Product=c100 Feb 18 20:37:04 sunvale kernel: [ 208.304148] usb 1-5: New USB device strings: Mfr=2, Product=1, SerialNumber=3 Feb 18 20:37:04 sunvale kernel: [ 208.304156] usb 1-5: Product: USB Flash Disk Feb 18 20:37:04 sunvale kernel: [ 208.304162] usb 1-5: Manufacturer: Netac Feb 18 20:37:04 sunvale kernel: [ 208.304167] usb 1-5: SerialNumber: 4880787365A536E3 Feb 18 20:37:04 sunvale kernel: [ 208.304980] scsi5 : usb-storage 1-5:1.0 Feb 18 20:37:04 sunvale mtp-probe: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:12.2/usb1/1-5" Feb 18 20:37:04 sunvale mtp-probe: bus: 1, device: 4 was not an MTP device Feb 18 20:37:05 sunvale kernel: [ 209.308678] scsi 5:0:0:0: Direct-Access Netac OnlyDisk 1.00 PQ: 0 ANSI: 2 Feb 18 20:37:05 sunvale kernel: [ 209.311032] sd 5:0:0:0: Attached scsi generic sg6 type 0 Feb 18 20:37:05 sunvale kernel: [ 209.649594] sd 5:0:0:0: [sdf] Assuming drive cache: write through Feb 18 20:37:05 sunvale kernel: [ 209.649602] sd 5:0:0:0: [sdf] Attached SCSI removable disk
There are no new lines added to /var/log/messages on the guest. (Yes, the flash drive referenced here is ancient. It is just a test device.) Further information:
# VBoxManage list usbhost Host USB Devices: ... UUID: c85d93b6-59a0-43b2-a347-e4f2d52dd924 VendorId: 0x0dd8 (0DD8) ProductId: 0xc100 (C100) Revision: 1.0 (0100) Manufacturer: Netac Product: USB Flash Disk SerialNumber: 4880787365A536E3 Address: sysfs:/sys/devices/pci0000:00/0000:00:12.2/usb1/1-5//device:/dev/vboxusb/001/0 04 Current State: Busy
The VBox manual seems to say that USB pass-through will not work if the USB device is actively used by the host. I presume this attachment constitutes active use, especially since it is reported as busy, but the drive is not mounted. (I have explicitly disabled auto-mount.) What do I need to do to let this device (and any other USB flash drives inserted) be seen by the guest?
Searching online finds only references to using auto-mount on the host, then sharing the mount directory with the guest. That is not an ideal solution in this case as software on the guest expects to mount the drive and would need to be extensively modified. Besides, I hate auto-mount.
The issue is the flash drive. What can't the guest see it?
Hi Dave,
If you are using VirtualBox-OSE from rpmfusion, there is no USB support. If you need USB support, you must install VirtualBox *and* the VirtualBox Extension pack, both from VirtualBox.org.
Kind regards
On 02/22/2012 02:59 AM, Joachim Backes wrote:
If you are using VirtualBox-OSE from rpmfusion, there is no USB support. If you need USB support, you must install VirtualBox *and* the VirtualBox Extension pack, both from VirtualBox.org.
I thought the OSE was no longer - and that there is only 1 version now and it should support USB no problem - I believe that was around 4.1.x but don't recall exactly ...
(PS - please don't cross post to dead list: fedora-x@redhat).
Emilio Lopez wrote:
You can also use Shared Folder, and share /media directory.
You know, I appreciate replies. But it would be so much nicer if those replying took the time to actually read the original message. I specifically addressed the idea of using a shared "folder" in that. I know its possible but I don't want to do that. I want VBox to work as advertised.
I also said that this may not really be a VBox problem. It may be just that Fedora is capturing the device so it is "busy" and not available to the guest. Let me try this again:
What can I do to stop Fedora from making the device busy?
On Wed, Feb 22, 2012 at 9:36 AM, Dave Close dave@compata.com wrote:
What can I do to stop Fedora from making the device busy?
One thing you didn't mention is if you right clicked on the USB icon in the bottom right of the virtual guest window. USB devices don't automatically get mapped to the guest unless you set it that way in the virtual guest settings. If everything is setup correctly, when you right click on the USB icon you should see your device in the list and be able to select it.
Richard
Richard Shaw wrote:
One thing you didn't mention is if you right clicked on the USB icon in the bottom right of the virtual guest window. USB devices don't automatically get mapped to the guest unless you set it that way in the virtual guest settings. If everything is setup correctly, when you right click on the USB icon you should see your device in the list and be able to select it.
Thank you !!! That does make the flash disk visible to the guest.
I had not tried that. Recall I'm usually running the guest headless so I don't even see that menu. When I started in non-headless mode, it works. But, while this shows that the pass-through can work, it doesn't really solve my problem.
There doesn't appear to be any checkbox in the VBox settings to make this automatic. And running headless, I won't normally be able to do it. There must be some command I can run in the guest to accomplish the same thing as the USB device menu. Perhaps I can put that command in the guest's rc.local.
On 02/23/2012 12:17 PM, Dave Close wrote:
Richard Shaw wrote:
One thing you didn't mention is if you right clicked on the USB icon in the bottom right of the virtual guest window. USB devices don't automatically get mapped to the guest unless you set it that way in the virtual guest settings. If everything is setup correctly, when you right click on the USB icon you should see your device in the list and be able to select it.
Thank you !!! That does make the flash disk visible to the guest.
I had not tried that. Recall I'm usually running the guest headless so I don't even see that menu. When I started in non-headless mode, it works. But, while this shows that the pass-through can work, it doesn't really solve my problem.
There doesn't appear to be any checkbox in the VBox settings to make this automatic. And running headless, I won't normally be able to do it. There must be some command I can run in the guest to accomplish the same thing as the USB device menu. Perhaps I can put that command in the guest's rc.local.
To attach a usb drive to my system I use...
VBoxManage controlvm F16-1 usbattach f6273fd2-4176-43dc-9e5b-11ce45b6b7d4
is that the kind of command you are looking for?
Ed Greshko wrote:
There doesn't appear to be any checkbox in the VBox settings to make this automatic. And running headless, I won't normally be able to do it. There must be some command I can run in the guest to accomplish the same thing as the USB device menu. Perhaps I can put that command in the guest's rc.local.
To attach a usb drive to my system I use... VBoxManage controlvm F16-1 usbattach f6273fd2-4176-43dc-9e5b-11ce45b6b7d4 is that the kind of command you are looking for?
Perhaps. I was thinking of something to run in the guest since that's where the checkbox seems to be. But maybe I'm just a bit naive. To run this on the host, I would need to detect when a drive is inserted, read its UUID, and then run the command. Is that the idea? I presume you aren't doing it automatically.
I can probably find a way to do this whenever a drive is inserted. But others may have better ideas so I'd love to hear suggestions.
On 02/23/2012 02:23 PM, Dave Close wrote:
Perhaps. I was thinking of something to run in the guest since that's where the checkbox seems to be. But maybe I'm just a bit naive. To run this on the host, I would need to detect when a drive is inserted, read its UUID, and then run the command. Is that the idea? I presume you aren't doing it automatically.
What makes you think the checkbox is on, or associated with, the guest? I think you are talking about the little USB connector at the bottom right on the screen surrounding guest display, yes?
The USB hardware exists on the host, so the host must release the USB hardware and "give" it to a particular guest. To do what you're suggesting, the guest would have to communicate with a service requesting the host to "give" it the hardware.
AFAIK, the available VBox commands on the guest are....
VBoxClient VBoxClient-all VBoxControl VBoxService
You could research those to see if they would do the needful thing.
Of course the documentation is here... https://www.virtualbox.org/wiki/Documentation
On 02/23/2012 02:23 PM, Dave Close wrote:
I can probably find a way to do this whenever a drive is inserted. But others may have better ideas so I'd love to hear suggestions.
I "think" I may know what you want....
What you need to do is define a "USB" filter. When the "guest" is started or when the device matching the filter is plugged in it will be automatically connected to the guest.
Of course you need to be careful, if you have multiple guests you can't have the same filters.
Ed Greshko wrote:
I "think" I may know what you want....
What you need to do is define a "USB" filter. When the "guest" is started or when the device matching the filter is plugged in it will be automatically connected to the guest.
Of course you need to be careful, if you have multiple guests you can't have the same filters.
I thought the same thing. As I read the documentation, that's exactly what a filter is supposed to do. But I have a "blank" filter, which claims it will connect any USB device, and that doesn't happen. My guest doesn't see the device until I select it in the guest menu. It's that problem which prompted my initial request for help.
In my case, I have only one guest. I'm only running VBox because the application won't run on a recent Fedora release and the hardware won't work with an old release. Solution, run the old release as a guest under the new release. But the application needs to use the flash drive.
On Thu, Feb 23, 2012 at 9:49 AM, Dave Close dave@compata.com wrote:
I thought the same thing. As I read the documentation, that's exactly what a filter is supposed to do. But I have a "blank" filter, which claims it will connect any USB device, and that doesn't happen. My guest doesn't see the device until I select it in the guest menu. It's that problem which prompted my initial request for help.
Perhaps the part that's confusing you is that a blank filter does not automatically grab the next inserted USB device. You have to tell it which device you want to use with the filter.
If you *ALWAYS* want that USB device connected to a particular guest when it's running, then you should: 1. Plug it in 2. Run virtualbox and open the settings for the host 3. Add the USB device (not a blank filter, but the device itself).
I can't remember if there's any check boxes to make it connect by default but that should do it. After that, if the device is plugged in when you start your guest it should automatically get connected. I'm not sure what will happen if you start the guest first and then plug in the USB device.
DISCLAIMER: I can't verify this from work so this is from memory and I might be completely wrong :)
Richard
On 02/23/2012 11:49 PM, Dave Close wrote:
I thought the same thing. As I read the documentation, that's exactly what a filter is supposed to do. But I have a "blank" filter, which claims it will connect any USB device, and that doesn't happen. My guest doesn't see the device until I select it in the guest menu. It's that problem which prompted my initial request for help.
In my case, I have only one guest. I'm only running VBox because the application won't run on a recent Fedora release and the hardware won't work with an old release. Solution, run the old release as a guest under the new release. But the application needs to use the flash drive.
As Richard said, you can't use a blank filter for this. You need specific filters for the device that you want to automatically connect.
I'd not used USB filters in a long time since in early implementations I found it buggy. So, today I verified that it works as expected if you have those specific filters defined.
Ed
On 02/23/2012 11:54 PM, Richard Shaw wrote:
I can't remember if there's any check boxes to make it connect by default but that should do it. After that, if the device is plugged in when you start your guest it should automatically get connected. I'm not sure what will happen if you start the guest first and then plug in the USB device.
If you start the guest first and then plug in the USB device it will get connected to the guest machine. I verified this earlier today.