NVMe detected, Admin Command doesn't work but works in real hardware.

Discussions related to using VirtualBox on Windows hosts.
Post Reply
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

Host Windows 10, VirtualBox 7.014 r161095 with NVM installed on motherboard (Asus Z70K) M.2 socket. Detected by Host and VBox but no result generated for Admin Identify Command (opcode: 6) under VBox but successful on real hardware, anyone experienced this issue ?. Would appreciate any feedback, Thank you.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by scottgus1 »

x86novice wrote: 30. Jan 2024, 11:15 NVM installed on motherboard ... no result generated for Admin Identify Command (opcode: 6) under VBox but successful on real hardware
This sounds to me like you're trying to run a command in the VM that accesses the host's hardware in some way. If this is what you're trying, it won't work.

The VM's "hardware" is completely virtualized, except for the CPU. You cannot run commands in the VM against the host's hardware, except possibly for the CPU. So you NVMe commands in the VM won't see the host's NVMe.

The reason that the main Virtualbox window can see the host's NVMe is because the main Virtualbox is an app running on the host, just like Notepad or Paint.
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

Thanks for your response.
Both VBox & VMware show the NVMe SSD Controller gets enumerated, my o/s boots off sata hdd (AHCI) and under VMware can access the virtualised ssd storage but not under VBox (system hangs) and your remark
The VM's "hardware" is completely virtualized, except for the CPU. You cannot run commands in the VM against the host's hardware, except possibly for the CPU. So you NVMe commands in the VM won't see the host's NVMe.
made me question if - with a few degrees of probability - that VBox implementation of NVMe Controller (with respect to SSD M.2 type) could potentially be buggy ?
Would also like to mention that the result of Identify Controller under VMware clearly shows its revision being 1.3.0 which matches the one from real hardware; whereas the VBox's is 1.2.0 in the unlikely event that this little info could be the root cause.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by scottgus1 »

Let's look at how your VM is set up:

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Attachments tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

The attachment as you requested, thanks in advance.
Attachments
BareMetal OS 64bit-2024-02-01-11-03-07.zip
(19.01 KiB) Downloaded 68 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by scottgus1 »

That's the vbox.log file. Not the .vbox file. I suspect the .vbox file will be called "BareMetal OS 64bit.vbox". Whatever the name is, it will have a .vbox extension, not a .log extension. Please send that file, per the instructions above.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by fth0 »

x86novice wrote: 31. Jan 2024, 02:20 Both VBox & VMware show the NVMe SSD Controller gets enumerated, my o/s boots off sata hdd (AHCI) and under VMware can access the virtualised ssd storage but not under VBox (system hangs)
I underlined the word where you're misinterpreting things:

VMware supports NVMe Passthrough, so the BareMetal OS can see the host's NVMe controller and the devices connected to it.

VirtualBox does not support NVMe Passthrough, so the BareMetal OS only sees the VM's virtual NVMe controller, which is completely independent of the host's NVMe controller. In consequence, you cannot access neither the host's NVMe controller nor any devices attached to that.

As to why the BareMetal OS hangs, it might have to do with processing the return of a NVMe-specific command, indicated by the following log message:
BareMetal OS 64bit-2024-02-01-11-03-07.log wrote:
00:00:08.545441 NVMe#0Wrk#0: Processing admin command 0xffff returned with error: VERR_PDM_NOT_PCI_BUS_MASTER


@scottgus1: Were you hoping to see something special in the .vbox file, which you'd like to know how to identify in the VBox.log file?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by scottgus1 »

fth0 wrote: 1. Feb 2024, 21:12 @scottgus1: Were you hoping to see something special in the .vbox file, which you'd like to know how to identify in the VBox.log file?
Yes. I saw what appears to be an NVMe controller in the log but nothing attached to it.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by fth0 »

scottgus1 wrote: 1. Feb 2024, 21:59 I saw what appears to be an NVMe controller in the log but nothing attached to it.
In the .vbox file you'd probably have seen more or less the same (note the "/" near the end of the one-liner):
Test.vbox wrote:
<StorageController name="NVMe" type="NVMe" PortCount="1" useHostIOCache="false" Bootable="false"/>
The CFGM dump section in the VBox.log file is a more detailed view of the VM's configuration. In the case of virtual disk images, I know that VirtualBox bails out before writing the CFGM dump if I delete the virtual disk image right before starting the VM. Otherwise, opening virtual disk images comes after the CFGM dump (search for "VD:"), so you'd see the virtual disk image in the /Devices/nvme section even if it couldn't be really used. But don't take my word for it. ;)
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

scottgus1 wrote: 1. Feb 2024, 04:19 That's the vbox.log file. Not the .vbox file. I suspect the .vbox file will be called "BareMetal OS 64bit.vbox". Whatever the name is, it will have a .vbox extension, not a .log extension. Please send that file, per the instructions above.
Sorry about that.

Thanks
Attachments
BareMetal OS 64bit.zip
(2.55 KiB) Downloaded 71 times
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

@ fth0
I underlined the word where you're misinterpreting things:

VMware supports NVMe Passthrough, so the BareMetal OS can see the host's NVMe controller and the devices connected to it.
Almost everything is being misinterpreted at the moment :lol: , as a result of VBox not producing the results; the use of VMware is a secondary choice without knowing what is passthrough and what is not passthrough under both VMs.
As to why the BareMetal OS hangs, it might have to do with processing the return of a NVMe-specific command, indicated by the following log message:
BareMetal OS 64bit-2024-02-01-11-03-07.log wrote:
00:00:08.545441 NVMe#0Wrk#0: Processing admin command 0xffff returned with error: VERR_PDM_NOT_PCI_BUS_MASTER
It must be the passthrough effect you mentioned above. For now, just got to be contented with the secondary VM before using the device as a physical drive under VBox.
Appreciate your comment, thank you.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by scottgus1 »

x86novice wrote: 3. Feb 2024, 00:18 Almost everything is being misinterpreted at the moment :lol: , as a result of VBox not producing the results;
It's important to understand the thing you're trying to get the results on. The hardware that appears inside the VM is not the hardware that exists on the host.

You can have an NVMe in a Virtualbox VM on a host that has only IDE drives. Or you can have a VM that has only IDE on a host that has only NVMe's. The host hardware and VM hardware are entirely different.

Like fth0 says above, your VM has an NVMe with no drive attached to it:
<StorageController name="NVMe" type="NVMe" PortCount="1" useHostIOCache="true" Bootable="true"/>
So maybe that's why the command doesn't work. Try attaching a drive to it.

*************************
Thanks, fth0, for the insight! I do see the similarity in the CFGM Dump section.
x86novice
Posts: 6
Joined: 30. Jan 2024, 09:09

Re: NVMe detected, Admin Command doesn't work but works in real hardware.

Post by x86novice »

Vbox is always a preferred VM but for now i just got to be contented with VMware or Qemu at this embryonic stage of my venture into NVMe, many thanks for all your prompt responses.
Have a nice day.
Post Reply