Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Mar 2022 12:54:53 +0100
From:      Mario Marietto <marietto2008@gmail.com>
To:        FreeBSD virtualization <freebsd-virtualization@freebsd.org>, hackers@freebsd.org
Subject:   Virtio-win driver (virtio-blk and virtio-scsi) don't work when they are used on bhyve with Windows 11 as guest os
Message-ID:  <CA%2B1FSigxiPPHcE-eig20a6S%2BVEquEwiwG_NvpOahPK3BQh=kng@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hello.

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 #8
n244809-dff3dead3734: Wed Feb 23 13:16:32 CET
2022     marietto@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. The disks attached
are 0 byte large,so they aren't recognized by Windows 11. Is this a bug or
what ? They are USB 3.0 disks. You can give a look at the images below if u
want to have a better understanding :


https://forums.freebsd.org/attachments/1-jpg.13311/
https://forums.freebsd.org/attachments/2-jpg.13312/


I've tried also 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/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 get this error :


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


I have tried also with :


-s 2,virtio-scsi,/dev/da4p2 \
-s 3,virtio-scsi,/dev/da2p1 \


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


https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-23-54-jpg.13321/
https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-10-16-jpg.13320/


Finally I tried by virtualizing ubuntu with bhyve using the virtio-scsi
driver on ubuntu as guest os and it worked,so there is a bug only on the
drivers for windows. You can see what happens with ubuntu going on the
freebsd forum at this address :


https://forums.FreeBSD.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/post-559924


I have also opened a bug request below,but no one replied until now.
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/747


-- 
Mario.

[-- Attachment #2 --]
<div dir="ltr"><div>Hello.</div><div><br></div><div></div><div><div><div id="gmail-m_-5563554548007041422gmail-issue-1172720202"><div><div><span><table><tbody><tr><td><p dir="auto"></p><p dir="auto">What I want to achieve is to pass thru two of my NTFS 
&quot;formatted&quot; 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.</p>
<p dir="auto"><br></p><p dir="auto">I&#39;m using this FreeBSD version :</p>
<div><pre><code><br>FreeBSD marietto 13.0-RELEASE FreeBSD 13.0-RELEASE #8 n244809-dff3dead3734: Wed Feb 23 13:16:32 CET
2022     marietto@marietto:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
</code></pre></div>
<p dir="auto"><br></p><p dir="auto">I&#39;ve configured the bhyve VM like this :</p>
<div><pre><code>
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](<a href="http://0.0.0.0:5904/" target="_blank">http://0.0.0.0:5904/</a>),w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \                           
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 &lt; /dev/null &amp; sleep 2 &amp;&amp; vncviewer 0:4
</code></pre></div>
<p dir="auto"><br></p><p dir="auto">These are the NTFS disks that I would like to see inside the Windows 11 guest os :</p>
<div><pre><code><br>-s 2,virtio-blk,/dev/da4p2 \
-s 3,virtio-blk,/dev/da2p1 \


=&gt;         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)


=&gt;         34  23437705149  da2  GPT  (11T)
           34         2014       - free -  (1.0M)
2048  23437701120    1  ms-basic-data  (11T)
23437703168         2015       - free -  (1.0M)
</code></pre></div>
<p dir="auto"><br></p><p dir="auto">As you can see I&#39;ve used the virtio-blk driver,so inside 
the Windows 11 VM I&#39;ve installed the latest version of the virtio 
drivers. The disks attached are 0 byte large,so they aren&#39;t recognized 
by Windows 11. Is this a bug or what ? They are USB 3.0 disks. You can 
give a look at the images below if u want to have a better understanding
 :</p>
<p dir="auto"><br></p><p dir="auto"><a href="https://forums.freebsd.org/attachments/1-jpg.13311/" rel="nofollow" target="_blank">https://forums.freebsd.org/attachments/1-jpg.13311/</a><br>;
<a href="https://forums.freebsd.org/attachments/2-jpg.13312/" rel="nofollow" target="_blank">https://forums.freebsd.org/attachments/2-jpg.13312/</a></p>;
<p dir="auto"><br></p><p dir="auto">I&#39;ve tried also like this :</p>
<div><pre><code><br>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](<a href="http://0.0.0.0:5904/" target="_blank">http://0.0.0.0:5904/</a>),w=1440,h=900 \
-s 30,xhci,tablet \
-s 31,lpc \                           
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 &lt; /dev/null &amp; sleep 2 &amp;&amp; vncviewer 0:4
</code></pre></div>
<p dir="auto"><br></p><p dir="auto">and I get this error :</p>
<p dir="auto"><strong><br></strong></p><p dir="auto"><strong>Assertion failed: (n &gt;= 2 &amp;&amp; n &lt;= 
BLOCKIF_IOV_MAX + 2), function pci_vtblk_proc, file 
/usr/src/usr.sbin/bhyve/pci_virtio_block.c, line 324.</strong></p>
<p dir="auto"><br></p><p dir="auto">I have tried also with :</p>
<div><pre><code><br>-s 2,virtio-scsi,/dev/da4p2 \
-s 3,virtio-scsi,/dev/da2p1 \
</code></pre></div>
<p dir="auto"><br></p><p dir="auto">and I have also installed the virtio-scsi driver on 
Windows 11,that has been accepted by windows,but the disks aren&#39;t 
recognized :</p>
<p dir="auto"><br></p><p dir="auto"><a href="https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-23-54-jpg.13321/" rel="nofollow" target="_blank">https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-23-54-jpg.13321/</a><br>;
<a href="https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-10-16-jpg.13320/" rel="nofollow" target="_blank">https://forums.freebsd.org/attachments/screenshot_2022-03-13_11-10-16-jpg.13320/</a></p>;
<p dir="auto"><br></p><p dir="auto">Finally I tried by virtualizing ubuntu with bhyve using 
the virtio-scsi driver on ubuntu as guest os and it worked,so there is a
 bug only on the drivers for windows. You can see what happens with 
ubuntu going on the freebsd forum at this address :</p><p dir="auto"><br></p>
<p dir="auto"><a href="https://forums.FreeBSD.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/post-559924" rel="nofollow" target="_blank">https://forums.FreeBSD.org/threads/usb-3-0-disks-not-recognized-by-windows-if-passed-through-as-slots.84402/post-559924</a></p><p dir="auto"><br></p><p dir="auto">I have also opened a bug request below,but no one replied until now. <br></p></td></tr></tbody></table></span></div></div></div></div></div><div><a href="https://github.com/virtio-win/kvm-guest-drivers-windows/issues/747" target="_blank">https://github.com/virtio-win/kvm-guest-drivers-windows/issues/747</a></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Mario.<br></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSigxiPPHcE-eig20a6S%2BVEquEwiwG_NvpOahPK3BQh=kng>