Vbox crashing with USB external drive

Discussions related to using VirtualBox on Linux hosts.
stephenboston
Posts: 15
Joined: 27. May 2019, 02:38

Vbox crashing with USB external drive

Post by stephenboston »

Since this most recent updates (see below) my Arch guest crashes before displaying the boot menu. No message.

I have tried with
  • two different disks
    two different disk enclosure brands and cables,
    different USB sockets on the host machine.
    different VMs with the same config
    different physical hosts
Other USB devices -- a wifi adapter -- does not cause this problem.


Arch host

Code: Select all

5.18.14-arch1-1
virtualbox (6.1.36-1)
virtualbox-guest-iso (6.1.36-1)
virtualbox-ext-oracle-6.1.36-1
virtualbox-host-modules-arch (6.1.36-4)

Arch guest

Code: Select all

5.18.14-arch1-1
Guest additions 6.1.36 (from host iso)

The VM log ends with this :

Code: Select all

 
00:00:02.367166 EFI: VBoxDbg> loadimage64 'R:/tinderbox/efi2-6.1/out/win.amd64/release/obj/VBoxEfiFirmware/amd64/RELEASE_VS2010/X64/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe/DEBUG/UsbBusDxe.efi' 0xdde42000 LB 0x5020
00:00:02.367766 EFI: VBoxDbg> loadimage64 'R:/tinderbox/efi2-6.1/out/win.amd64/release/obj/VBoxEfiFirmware/amd64/RELEASE_VS2010/X64/MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe/DEBUG/UsbKbDxe.efi' 0xdde3e000 LB 0x3ca0
00:00:02.368461 EFI: VBoxDbg> loadimage64 'R:/tinderbox/efi2-6.1/out/win.amd64/release/obj/VBoxEfiFirmware/amd64/RELEASE_VS2010/X64/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe/DEBUG/UsbMassStorageDxe.efi' 0xdde3a000 LB 0x3080
00:00:02.454343 Display::i_handleDisplayResize: uScreenId=0 pvVRAM=00007f471c000000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0 origin=0,0
00:00:02.545767 PS2K: Selected scan set 2
00:00:02.546451 xHCI: Hardware reset

nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Re: Vbox crashing with USB external drive

Post by nixuser »

Exact same problem (and same final log entry) with Fedora 36.

As a workaround, don't pre-assign a USB storage device to the VM. After the VM boots add the same USB device to the VM through the GUI and it works. Obviously this manual interaction is a pain and not a long term solution.

In my case the issue was observed with a USB 3 thumb drive and an external USB 3 dual disk caddy.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Vbox crashing with USB external drive

Post by scottgus1 »

If you would both post the latest logs of such a crash, we might be able to help.

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Re: Vbox crashing with USB external drive

Post by nixuser »

The VM doesn't actually start, it aborts, and the VB Manager labels the VM as "Aborted".

Here is the log.
Attachments
log.txt.zip
Log file for USB storage crash
(19.24 KiB) Downloaded 17 times
nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Re: Vbox crashing with USB external drive

Post by nixuser »

drwillis
Posts: 1
Joined: 2. Aug 2022, 00:36

Re: Vbox crashing with USB external drive

Post by drwillis »

I have this problem too on two different PCs, and I would strongly suggest you stop using USB3 for storage until it is resolved.

PC1: Linux Host, Linux guest (ubuntu 20.04/ubuntu 20.04)
external USB hard drive attached and forwarded into the VM.
if USB3 is enabled the VM aborts on startup, setting to USB2 works normally.

PC2: also 20.04 host. blank guest.
I was using virtualbox to restore a Clonezilla (3.0.1.8 ) image into a VDI so that I could resize the partitions and re-image.
the image resided on an external USB, attached the clonezilla.iso and created an empty VDI
but with USB set to USB3, clonezilla booted fine, and I could see the USB drive but on restore *It reported the source image was corrupt!*
set the VM to USB2 and it restored perfectly.
Since there was evidence of data corruption, I would not recommend using USB3 for storage until the problem is corrected.
stephenboston
Posts: 15
Joined: 27. May 2019, 02:38

Re: Vbox crashing with USB external drive

Post by stephenboston »

My USB external drive will not attach under USB 2.0
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Vbox crashing with USB external drive

Post by fth0 »

What happens if you attach the USB device when the VM is already running?
nixuser
Posts: 32
Joined: 12. Dec 2018, 04:56

Re: Vbox crashing with USB external drive

Post by nixuser »

I suggested that as a workaround. In my experience it works. Don't pre-assign the device, add it after the VM has booted and is running. For me this works.

I have not seen any evidence of data corruption so far doing it this way, but I would be very cautious not to use a volume that has critical data on it just in case.
PeterWang-dev
Posts: 7
Joined: 28. Jul 2022, 17:24

Re: Vbox crashing with USB external drive

Post by PeterWang-dev »

nixuser wrote:I suggested that as a workaround. In my experience it works. Don't pre-assign the device, add it after the VM has booted and is running. For me this works.

I have not seen any evidence of data corruption so far doing it this way, but I would be very cautious not to use a volume that has critical data on it just in case.
Same issue on Windows 11 host with 6.36 vbox and extension installed. I installed my arch on usb external ssd drive for some particular needs. When vm booted and I tried to load iniramfs, booting into my arch on ssd. Same error appers and application crashed. I had to roll back to 6.14.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Vbox crashing with USB external drive

Post by scottgus1 »

PeterWang-dev wrote:I installed my arch on usb external ssd drive
Peter, how is your VM configured? Is the VDI on the external drive? Or are you inserting this USB drive into the running VM using Virtualbox USB Filters?

It appears that this topic's issue is about inserting a USB device into a running VM on the host. Then the USB device disconnects from the host and goes into the VM, and troubles ensue.

It sounds at first to me like your VM is on the SSD and the host remains in control of the USB drive. If so this topic is a different issue than what you're havng. We can move this to a separate topic and help to solve it if your VM is having different trouble.
PeterWang-dev
Posts: 7
Joined: 28. Jul 2022, 17:24

Re: Vbox crashing with USB external drive

Post by PeterWang-dev »

scottgus1 wrote:
PeterWang-dev wrote:I installed my arch on usb external ssd drive
Peter, how is your VM configured? Is the VDI on the external drive? Or are you inserting this USB drive into the running VM using Virtualbox USB Filters?

It appears that this topic's issue is about inserting a USB device into a running VM on the host. Then the USB device disconnects from the host and goes into the VM, and troubles ensue.

It sounds at first to me like your VM is on the SSD and the host remains in control of the USB drive. If so this topic is a different issue than what you're havng. We can move this to a separate topic and help to solve it if your VM is having different trouble.
Thanks for your reply. Actually i was booting actural arch on my ssd via filter. I was pretty sure that my ssd was connected on vm successfully. However error occured as this post had mentioned when i got into grub and tried to load iniramfs from external ssd drive connected to vm via filter. I know my need is a little werid. But I think this error is likely related to this bug, cause the version before like 6.1.34 behaved normally.
mgrzegor
Posts: 1
Joined: 8. Jun 2019, 19:31

Re: Vbox crashing with USB external drive

Post by mgrzegor »

I also seem to be having the same issue in a different scenario — namely, doing an xHCI controller reset from the VM.

Full story:

I have two USB 3.0 external HD drives I am frequently using in an Ubuntu guest under the Windows 10 host. Because I use them frequently, I tend to keep them plugged in and attached (via USB filters) to the VM; however, on the VM boot, I prefer to have them not attached, because otherwise the mapping of drives in /dev changes in a way I do not like.
For a long time, I have been having a problem where the VM’s xHCI controller sometimes stops working if the drives are attached for a long time. It appears to happen randomly; sometimes I get more than a week continuous uptime without a hitch, other times the problem occurs already after a few hours. When it does occur, I get something like this in the guest’s kern.log:
Sep 18 05:05:08 VirtualBox kernel: [34550.375803] xhci_hcd 0000:00:0c.0: ERROR mismatched command completion event
Sep 18 05:05:08 VirtualBox kernel: [34550.375811] xhci_hcd 0000:00:0c.0: ERROR mismatched command completion event
Sep 18 05:05:08 VirtualBox kernel: [34550.375812] xhci_hcd 0000:00:0c.0: ERROR mismatched command completion event
Sep 18 05:05:13 VirtualBox kernel: [34555.418708] xhci_hcd 0000:00:0c.0: ERROR mismatched command completion event
Sep 18 05:05:21 VirtualBox kernel: [34562.587517] xhci_hcd 0000:00:0c.0: xHCI host not responding to stop endpoint command.
Sep 18 05:05:21 VirtualBox kernel: [34562.587841] xhci_hcd 0000:00:0c.0: xHCI host controller not responding, assume dead
Sep 18 05:05:21 VirtualBox kernel: [34562.587864] xhci_hcd 0000:00:0c.0: HC died; cleaning up
Sep 18 05:05:21 VirtualBox kernel: [34562.587872] xhci_hcd 0000:00:0c.0: xHCI host not responding to stop endpoint command.
I have figured out that when the above problem happens, I can fix it without restarting the VM by issuing the following commands from a root prompt:
echo -n "0000:00:0c.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
echo -n "0000:00:0c.0" > /sys/bus/pci/drivers/xhci_hcd/bind
This workaround has been working for me for a long time, back to at least VB version 5.0.40 (except for a time there was a bug in Linux’s xhci driver that caused it to segfault about half of the time I did the above — but that was a problem with Linux, not VB).

Now, since VB 6.1.36, if I issue the first of the above commands (“unbind”) while the USB 3.0 drives are still attached to the VM, the VM crashes with an “unhandled exception” message box.
I have already reported it on the bugtracker (Ticket #21108), see there for the crash log.

After a couple of tests I have determined that:
  • the crash occurs if either of the USB 3.0 drives are attached to the VM;
  • the crash does not occur if I detach the drives before issuing the “unbind” command;
  • having a USB 2.0 drive attached does not result in the crash (as long as no USB 3.0 drive is attached);
  • having any of the USB 3.0 drives attached while booting the Ubuntu guest (which, as stated above, is not something I normally do) results in the crash at the time the drive audibly spins up.
No data corruption observed yet, but I will definitely keep an eye for that.
Also, I will probably revert to 6.1.34 until the issue is fixed, because I am afraid the VM might crash if the xhci driver issues a controller reset while I am accessing one of the external drives. (I have observed such resets sporadically in all previous versions of VirtualBox; before this bug, they have been usually harmless.)
seancg72
Posts: 1
Joined: 27. Sep 2022, 10:11

Re: Vbox crashing with USB external drive

Post by seancg72 »

Hi Guys,

VirtualBox : 6.1.36/38
Host : Ubuntu 20.04 (Ryzen 5 3400G with Radeon Vega Graphics 32GB ram)
Guest : Windows 7 SP1

I too have found USB passthrough with a filter crashes my VM during boot up.

I have had issues with USB Passthrough since 6.1.36 was released with a Windows 7 SP1 VM.

The Windows7 VM has a USB filter on an external USB SSD drive which grabs it during startup.
This has picked up this drive upon the Windows 7 Guest starting flawlessly up to VirtualBox 6.1.34 (last version it worked)

However in July 2022, when I tried to upgrade to 6.1.36 as the VM started it crashed as soon as it grabbed the USB from the host. It would simply crash and terminated the VM window.
In 6.1.36 I had to completely disabled the USB for it to boot.
This totally rendered my usb device useless. As this machine and the ssd was critical I rolled VirtualBox back to 6.1.34.

Now 6.1.38 has been released I thought I would give it another go as this last week all my VMs have been crashing (most likely due to Ubuntu updating too many low level libraries)
After upgrading 6.1.38 the VM still crashed.
I looked at the logs and it suggested it had a moment when it tried to talk to the old guest editions (yes I know).
As I could not boot normally, I booted the windows 7 into Safe Mode and removed the 6.34 guest additions that way.
Having removed the editions and rebooted it then booted fine using default vga driver.

I then installed the 6.1.38 editions pack. So far so good.
It too boots (without the usb filter enabled).
I then rebooted once more to make sure it did a clean round trip and that was ok too.
This time once fully booted and logged into Windows 7, I selected from the VirtualBox Devices/USB Menu the USB device and it mounted the USB SSD without issues and it worked at this point.

So once more shutdown the VM and then renabled the usb filter for this device. Again as it started the VM it crashes again.

I also tried removing the old filter and recreating but the same thing happens.
With the filter enabled at start up and the SSD running, the VM crashes during startup.

It just won't boot with the USB passthrough filter set and enabled.

I have taken samples if the VMs log file from the last good 6.1.34 that was working to until this version.
Sorry for the long names

Files attached are :
0.VBox.20220923_6-1-34-Passthrough Enabled Working at bootlog.log (Last time it fully worked)
1.VBox_20220925_6-1-38-PassThrough.log (after upgrading to 6.1.38 and new 6.1.38 extension pack installed - filter enabled at boot - Crashes)
2.VBox_20220925_6-1-38-PassThrough-recreated.log (after upgrading to 6.1.38 and new 6.1.38 extension pack installed - Creating new filter enabled at boot - Crashes)

The USB Filter settings are settings are:
Name: Ugreen Storage Device [0100]
Vendor ID: 174c
Product ID: 55aa
Revision: 0100
Manufacturer: Ugreen
Product: Ugreen Storage Device
Serial No: #############
Port:
Remote: No

Hope this helps in finding an answer.

Sean
Attachments
2.VBox_20220925_6-1-38-PassThrough-recreated.log
after upgrading to 6.1.38 and new 6.1.38 extension pack installed - Creating new filter enabled at boot - Crashes
(79.32 KiB) Downloaded 1 time
1.VBox_20220925_6-1-38-PassThrough.log
after upgrading to 6.1.38 and new 6.1.38 extension pack installed - filter enabled at boot - Crashes
(79.5 KiB) Downloaded 2 times
0.VBox.20220923_6-1-34-Passthrough Enabled Working at bootlog.zip
Last time it fully worked 6.1.34
(45.32 KiB) Downloaded 1 time
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Vbox crashing with USB external drive

Post by fth0 »

This issue should be fixed in the VirtualBox test builds 6.1.39r153816 and newer.
Post Reply