VirtualBox

Opened 6 years ago

Last modified 8 months ago

#17228 new defect

5.2.0 breaks NVMe support on Win10 1703 or later [regression]

Reported by: chrfranke Owned by:
Component: other Version: VirtualBox 5.2.0
Keywords: Cc:
Guest type: Windows Host type: Windows

Description

NVMe drive stopped working in a Win10 1703 VM after upgrading VB from 5.1.18 to 5.2.0.

In Device Manager, stornvme.sys is shown with yellow exclamation and (the German version of) this error message: This device cannot start. (Code 10) An invalid parameter was passed to a service or function.

With an older 1607 snapshot of same VM, NVMe worked again. After copying stornvme.sys from 1607 to 1703, NVMe worked again. Same with a fresh install of 1709 (upgrade install crashed VB 5.2.0): NVMe failed and worked again after downgrading the driver.

Test results after downgrading VB to latest 5.1:

stornvme.sys 5.1.18/30 5.2.0
10.0.14393.0 (1607) OK OK
10.0.15063.0 (1703) OK Error
10.0.16299.15 (1709) OK Error

Possibly related or duplicate: #16078.

Change History (11)

comment:1 by aeichner, 6 years ago

The NVMe driver in the Fall Creators update doesn't work if the device exposes MSI-X and the controller memory buffer feature of NVMe introduced with 5.2.0. Older versions and other guests don't show this behavior and we are investigating it. Use the following commands to work around this issue in the meantime:

VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/MsiXSupported" 0
VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/CtrlMemBufSize" 0

This will disable MSI-X support and the controller memory buffer feature but makes the newer NVMe driver work with our emulation.

comment:2 by chrfranke, 6 years ago

Thanks. Works with 1703. On 1709, driver load succeeds, but guest freezes during write commands (e.g. formatting). Workaround: Add a second CPU. In all cases, it worked also without MsiXSupported setting.

Test results:

CtrlMemBufSize unset CtrlMemBufSize 0, 1 CPU CtrlMemBufSize 0, 2 CPUs
1703 Driver not loaded OK OK
1709 Driver not loaded Guest freezes on writes OK

comment:3 by lk3, 6 years ago

I am able to get NVMe working on a Windows 10 1709 install using:

VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/MsiXSupported" 0 VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/CtrlMemBufSize" 0

However, when I give the VM more than 1 cpu core, the VM will BSOD on boot. Dropping the vm back to 1 core allows the VM to boot. I suspect this is something to do with NVMe. Tested on both 5.2.8 and 5.2.9.

Has anyone else seen this behavior?

comment:4 by csm10495, 6 years ago

Actually it looks like the 'drive' is returning error SF.SC == 14 / 0x0E to say feature not supported when stornvme tries to send SetFeatures with a FID of 0x08 for Interrupt Coalescing. Which is leading to the error code 10. In my own build of stornvme, I added a build-switch to ignore that error and continue with initialization. That works, though ultimately the drive should just return success (and could probably just ignore the command data).

That worked for me on a single core VM, haven't tried on multi-core.

Seems like a valid bug since the drive is violating the NVMe Spec by failing a required feature.

comment:5 by Chai T. Rex, 6 years ago

Comment 1 works nicely with an NVMe controller, SSD disk image mode, with no host OS cache in VirtualBox 5.2.16.

I couldn't get Windows 10 1803 installer to see the virtual disk even existed initially. With just CtrlMemBufSize, it saw the disk and installed but I kept getting file corruption (for example, I had problems with Windows Update and needed sfc /scannow to get the update to go through, which didn't inspire confidence). With both changes and a clean install, things work nicely.

How do I revert those changes when this bug is fixed?

comment:6 by scottgus1, 4 years ago

A Windows 10 guest (2004 build 19041.329) on Virtualbox 6.1.10 r138449 has this "(Code 10) An invalid parameter was passed to a service or function" problem on the NVMe controller, until I put the suggested vboxmanage commands in the guest. Then the NVMe controller starts, the attached .vdi gets recognized as a usable disk.

comment:7 by scottgus1, 4 years ago

re "How do I revert those changes when this bug is fixed?"

issue the commands again, but without the end space and 0:

VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/MsiXSupported"
VBoxManage setextradata <VM name> "VBoxInternal/Devices/nvme/0/Config/CtrlMemBufSize"

comment:8 by MikhailRokhin, 3 years ago

Approve the work-around. ticket:20447

Is there the same solution for case, where USB/NVMe HDD fails to boot (UEFI enabled)?

Last edited 3 years ago by MikhailRokhin (previous) (diff)

comment:9 by bmeirelles_rj, 11 months ago

Did you manage to fix this? I'm using 7.0.4 and the problem persists. Bill gates will be pissed

comment:10 by nosaj, 8 months ago

Last edited 8 months ago by nosaj (previous) (diff)

comment:11 by Artem S. Tashkinov, 8 months ago

This bug still affects Windows 11 (Win11_22H2_English_x64v2.iso) and VirtualBox 7.0.10.

Looks like it's not been fixed.

The workaround in comment 1 still works.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use