USB drive captured, reboot needed to reuse drive. BSOD

Discussions related to using VirtualBox on Windows hosts.
Post Reply
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

VirtualBox version: 6.1.22
Windows host: Windows 10 Home, 20H2, 64-bit
RAM: 8.00 GB (7.87 GB usable)
Linux guest: Ubuntu 16.04, (also Ubuntu 20.04, CentOS7)
base memory: 2048MB

I followed the instructions on USB basics and troubleshooting and am using a filter. I fire up the VM, plug in the USB drive, and everything works fine.
The issue is when exit. I eject the drive before shutting down, but when the VM is all shut down, and even when I exit the VirtualBox manager GUI, I can't Safely Remove the drive. I have to shutdown/reboot the host, and after a good while, I get a BSOD with DRIVER POWER STATE FAILURE.

The drive I'm trying is a Seagate Ultra Slim 2TB USB3 drive. File system is NTFS. I'm also having the same problem with a Lacie Rugged Mini 2TB USB3 drive (also NTFS)

I have no problem with a SanDisk Ultra 64GB USB3 thumb drive (FAT32).

Thanks for any help.
Attachments
VBoxHardening.zip
(31.8 KiB) Downloaded 9 times
VBox.zip
guest log file
(29.03 KiB) Downloaded 9 times
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

Tried turning off firewall. Didn't help.
ERROR in VBoxSVC.log that I didn't attach earlier. Attaching it now.

00:03:46.781749 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={ad47ad09-787b-44ab-b343-a082a3f2dfb1} aComponent={MediumWrap} aText={Medium 'D:\VirtualBox VMs\Ubuntu\Ubuntu 16.04\Ubuntu 16.04.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false aResultDetail=0
Attachments
VBoxSVC.zip
(2.48 KiB) Downloaded 6 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by scottgus1 »

Just want to let you know we've seen your topic, just haven't figured out how to troubleshoot it yet.
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

Thanks. Good to know. I think this seems to be a common problem. I've seen a lot of posts about BSOD when computer goes to sleep, and I suspect that it's because of a USB drive that was plugged in.

Since I'm here, I may as well add a bit more info. In Device Manager, the device shows up as

USB Attached SCSI (UAS) Mass Storage Device

under Storage Controllers. If I plug in the drive before firing up VirtualBox, I can eject it normally. It's only when the drive is plugged in after VirtualBox is running (w/o a VM running) that I can't eject the drive w/o a reboot.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by scottgus1 »

The "still attached" error reported above is normal, I get it in my working Virtualbox log too.

I did notice one odd thing:
D:\Program Files\Oracle\VirtualBox\VirtualBoxVM.exe
Seems Virtualbox is not installed in the default "C:\Program Files". While this might not cause the trouble you're having, "C:\Program Files" has special permissions that should be in place around Virtualbox, which could allow greater surface area for malware to attack if Virtualbox is in an unprotected folder. Your host OS appears to be booting from a C:\ drive.

I see the extra USB device coming in:
the vbox.log wrote:00:02:15.715864 VUSB: Disabled '00000000056c0fc0[proxy 0bc2:ab2e]' remote wakeup for configuration 0
00:02:15.820878 VUSB: Attached '00000000056c0fc0[proxy 0bc2:ab2e]' to port 1 on RootHub#0 (SuperSpeed)
00:02:40.245193 VUSB: Detached '00000000056c0fc0[proxy 0bc2:ab2e]' from port 1 on RootHub#0
The first "Disabled" line I don't recognize. But the other two are normal.

A power-based BSOD seems to indicate something on the host that is causing trouble. Your Seagate and Lacie 2TB drives are having the problem. Both are 2.5" drives in a USB enclosure, it appears. Do you have a flash thumb drive you can try in the same fashion?
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

My D:\ is larger and has more room, so I tend to install programs there if the installer lets me do it easily. (I basically just change 'C:' to 'D:' during installation)
I think I tried installing in C: to see if that was the issue, and when it didn't help I reinstalled on D: I honestly don't remember. I'll try that and see what happens.

Could the Disabled line you didn't recognize be the unchecked USB filter? Here a screen shot if that's ok.

I do have a flash drive and that works just fine. That shows up in Device Manager as
USB Mass Storage Device
under Universal Serial Bus controllers.
Attachments
screenshot of VM USB settings
screenshot of VM USB settings
VM_USB_settings.png (36.5 KiB) Viewed 1983 times
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

Installing to C: instead of D: made no difference.
Some new info:
I monitored Device Manager while starting up the VM (no USB drive plugged in).
After the VM was up and running, I plugged in the drive. Device manager then shows
VirtualBox USB
under Universal Serial Bus controllers (not under Storage controllers)

If I eject the drive from the VM and unplug the drive. Then when I shutdown and close the VirtualBox Manager, then when I plug the drive in again, it shows up as
USB Attached SCSI (UAS) Mass Storage Device
under Storage controllers.

If the drive is plugged in before VirtualBox Manager, I'm fine and the VM will see the drive. If I shutdown the VM before pulling the drive though, I'll need to reboot to get the drive back in Windows. (I did notice that I don't get a BSOD if I'm on battery - I don't get that It still takes a long time to reboot as when I do get a BSOD when the laptop is plugged in.)

There's also a problem if I plug the drive in when VirtualBox Manager is running, but before I start a VM.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by scottgus1 »

tjwilli wrote:Installing to C: instead of D: made no difference.
OK, it was a good experiment, thanks for trying! However, "C:\Program Files" is more secure, I think.
tjwilli wrote:After the VM was up and running, I plugged in the drive. Device manager then shows VirtualBox USB under Universal Serial Bus controllers (not under Storage controllers)
This is normal when the Virtualbox USB Filter redirects the device into the VM.
tjwilli wrote:USB Attached SCSI (UAS) Mass Storage Device
under Storage controllers.
This is not normal. Seems like for some reason your host OS is mis-identifying the devices. The BSOD might happen because SCSI devices aren't hot-pluggable, maybe? Just guessing now.

Curious that the thumb drive does not do this. I wonder if the host OS has a bit-flip or some other such bug on your host PC.

This is not a common problem, based on my forum browsing. I am unsure what else to do, aside from switching drives in the host, fresh-installing the host OS and Virtualbox as a test, and see if the same thing happens on that fresh install.
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

I believe that the flash drive works because it comes up under under Universal Serial Bus controllers, just like VirtualBox USB. I guess VirtualBox doesn't really support USB drives that are mounted under Storage controllers fully.

What I'm going to start doing is try to remember to physically unplug my USB drive BEFORE I shut down my VM, and make sure that I don't have a USB plugged in when VirtualBox Manager is running.
Thanks for looking into this.

Some posts I think MAY be related:

viewtopic.php?f=6&t=102216&p=496462&hil ... er#p496462
viewtopic.php?f=2&t=92591&p=446039&hili ... er#p446039
viewtopic.php?f=6&t=68431&p=325246&hili ... er#p325246
https://www.virtualbox.org/ticket/19326
viewtopic.php?f=6&t=92122&p=443148&hili ... er#p443148
viewtopic.php?f=2&t=91579&p=440041&hili ... er#p440041
tjwilli
Posts: 7
Joined: 1. May 2021, 23:56

Re: USB drive captured, reboot needed to reuse drive. BSOD

Post by tjwilli »

Follow-up for anyone finding this thread:
tjwilli wrote: What I'm going to start doing is try to remember to physically unplug my USB drive BEFORE I shut down my VM, and make sure that I don't have a USB plugged in when VirtualBox Manager is running.
this strategy is working great for me.
Post Reply