virtio-blk and virtio-scsi driver don't work with bhyve

Mario Marietto marietto2008 at gmail.com
Sun Mar 13 11:55:45 UTC 2022


Hello.

I'm going to ask another question about the behavior,because I want to
understand if I'm dealing with a bug or with a regular method of working.
So,please be patient with me. What I want to achieve is to pass thru two of
my NTFS "formatted" disks to a Windows 11 VM,but without passing them thru
using the USB controller in FreeBSD with a bhyve virtual machine (in the
example below I tried to boot Windows 11 from the nvme disk nvd0.

I'm using this FreeBSD version :

*FreeBSD marietto 13.0-RELEASE FreeBSD 13.0-RELEASE #5
n244809-dff3dead3734: Wed Feb 23 13:16:32 CET
2022     marietto at marietto:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64*


I've configured the bhyve VM like this :

*bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/dev/nvd0 \
-s 2,virtio-blk,/dev/da4p2 \
-s 3,virtio-blk,/dev/da2p1 \
-s 8,virtio-net,tap4 \
-s 10,hda,play=/dev/dsp,rec=/dev/dsp \
-s 29,fbuf,tcp=0.0.0.0:5904 <http://0.0.0.0:5904>,w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4*


These are the NTFS disks that I would like to see inside the Windows 11
guest os :

-s 2,virtio-blk,/dev/da4p2 \
-s 3,virtio-blk,/dev/da2p1 \
*
=>         34  19532873661  da4  GPT  (9.1T)
           34        32734    1  ms-reserved  (16M)
32768  19532838912    2  ms-basic-data  (9.1T)
19532871680         2015       - free -  (1.0M)


=>         34  23437705149  da2  GPT  (11T)
           34         2014       - free -  (1.0M)
2048  23437701120    1  ms-basic-data  (11T)
23437703168         2015       - free -  (1.0M)*


As you can see I've used the virtio-blk driver,so inside the Windows 11 VM
I've installed the latest version of the virtio drivers. You can see what's
the problem by taking a look at the images below. They are 0 byte large,so
they aren't recognized by Windows 11. Is this a bug or what ? I've also
used the ahci-hd driver but I've got the same result. They are USB 3.0
disks.

[image: 1.jpg]
[image: 2.jpg]
I've tried also :

*bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/dev/nvd0 \
-s 2,virtio-blk,/dev/da4 \
-s 3,virtio-blk,/dev/da2 \
-s 8,virtio-net,tap4 \
-s 10,hda,play=/dev/dsp,rec=/dev/dsp \
-s 29,fbuf,tcp=0.0.0.0:5904 <http://0.0.0.0:5904>,w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4*


and I've got this error :


*Assertion failed: (n >= 2 && n <= BLOCKIF_IOV_MAX + 2), function
pci_vtblk_proc, file /usr/src/usr.s
bin/bhyve/pci_virtio_block.c, line 324.*

and I have also used the virtio-scsi driver like this :


*bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/dev/nvd0 \
-s 2,virtio-scsi,/dev/da4 \
-s 3,virtio-scsi,/dev/da2 \
-s 8,virtio-net,tap4 \
-s 10,hda,play=/dev/dsp,rec=/dev/dsp \
-s 29,fbuf,tcp=0.0.0.0:5904 <http://0.0.0.0:5904>,w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4*


and I've installed the scsi driver taking it from this virtio iso file :

*https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.215-1/virtio-win-0.1.215.iso
<https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.215-1/virtio-win-0.1.215.iso>
*


and I have also installed the virtio-scsi driver,that has been
accepted by windows,but the disks aren't recognized :

it has been accepted by windows,but the disks aren't recognized :


[image: 3.jpg]
[image: 4.jpg]

There are clearly various bugs to fix.

I will keep the discussion updated also here :

*https://forums.freebsd.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/#post-559892
<https://forums.freebsd.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/#post-559892>*

-- 
Mario.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20220313/b510bdce/attachment.htm>


More information about the virt-tools-list mailing list