Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2022 08:15:39 +1100
From:      <jason@tubnor.net>
To:        "'Mario Marietto'" <marietto2008@gmail.com>, "'FreeBSD virtualization'" <freebsd-virtualization@freebsd.org>, <hackers@freebsd.org>
Subject:   RE: 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:  <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net>
In-Reply-To: <CA%2B1FSigxiPPHcE-eig20a6S%2BVEquEwiwG_NvpOahPK3BQh=kng@mail.gmail.com>
References:  <CA%2B1FSigxiPPHcE-eig20a6S%2BVEquEwiwG_NvpOahPK3BQh=kng@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart message in MIME format.

------=_NextPart_000_02EF_01D8427C.02E3EFA0
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

=20

=20

=20


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've configured the bhyve VM like this :

=20
bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -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=3D/dev/dsp,rec=3D/dev/dsp \
-s 29,fbuf,tcp=3D[0.0.0.0:5904](http://0.0.0.0:5904/),w=3D1440,h=3D900 \
-s 30,xhci,tablet \
-s 31,lpc \                          =20
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4

=20

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 \
=20
=20
=3D>         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)
=20
=20
=3D>         34  23437705149  da2  GPT  (11T)
           34         2014       - free -  (1.0M)
2048  23437701120    1  ms-basic-data  (11T)
23437703168         2015       - free -  (1.0M)

I've tried also like this :


bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -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=3D/dev/dsp,rec=3D/dev/dsp \
-s 29,fbuf,tcp=3D[0.0.0.0:5904](http://0.0.0.0:5904/),w=3D1440,h=3D900 \
-s 30,xhci,tablet \
-s 31,lpc \                          =20
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \
vm4 < /dev/null & sleep 2 && vncviewer 0:4

=20

and I get this error :

=20

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

I have also opened a bug request below,but no one replied until now.=20

=20

Use nvme or ahci-hd for da4/da2 and see what you get. The whole disk =
needs to go in there so Windows sees the GPT label. The other thing that =
comes to mind is that FreeBSD has hold of the disks and won=E2=80=99t =
allow them to be inserted, similar to issues when passing zvol into =
guests when volmode<>dev.

=20

Cheers,

=20

Jason.


------=_NextPart_000_02EF_01D8427C.02E3EFA0
Content-Type: text/html;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta =
name=3DGenerator content=3D"Microsoft Word 15 (filtered =
medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
code
	{mso-style-priority:99;
	font-family:"Courier New";}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	font-size:10.0pt;
	font-family:"Courier New";}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;
	mso-fareast-language:EN-AU;}
span.EmailStyle24
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-AU link=3Dblue =
vlink=3Dpurple style=3D'word-wrap:break-word'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><div =
style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm =
4.0pt'><div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><div><div =
id=3D"gmail-m_-5563554548007041422gmail-issue-1172720202"><div><div><tabl=
e class=3DMsoNormalTable border=3D0 cellpadding=3D0><tr><td =
style=3D'padding:.75pt .75pt .75pt .75pt'><p>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.<o:p></o:p></p><p>I've configured the =
bhyve VM like this =
:<o:p></o:p></p><div><pre><code><o:p>&nbsp;</o:p></code></pre><pre><code>=
bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A =
\<o:p></o:p></code></pre><pre><code>-s 0,hostbridge =
\<o:p></o:p></code></pre><pre><code>-s 1,ahci-hd,/dev/nvd0 =
\<o:p></o:p></code></pre><pre><code>-s 2,virtio-blk,/dev/da4p2 =
\<o:p></o:p></code></pre><pre><code>-s 3,virtio-blk,/dev/da2p1 =
\<o:p></o:p></code></pre><pre><code>-s 8,virtio-net,tap4 =
\<o:p></o:p></code></pre><pre><code>-s =
10,hda,play=3D/dev/dsp,rec=3D/dev/dsp =
\<o:p></o:p></code></pre><pre><code>-s 29,fbuf,tcp=3D[0.0.0.0:5904](<a =
href=3D"http://0.0.0.0:5904/" =
target=3D"_blank">http://0.0.0.0:5904/</a>),w=3D1440,h=3D900 =
\<o:p></o:p></code></pre><pre><code>-s 30,xhci,tablet =
\<o:p></o:p></code></pre><pre><code>-s 31,lpc =
\=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 <o:p></o:p></code></pre><pre><code>-l =
bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd =
\<o:p></o:p></code></pre><pre><code>vm4 &lt; /dev/null &amp; sleep 2 =
&amp;&amp; vncviewer =
0:4<o:p></o:p></code></pre></div><p><o:p>&nbsp;</o:p></p><p>These are =
the NTFS disks that I would like to see inside the Windows 11 guest os =
:<o:p></o:p></p><div><pre><br><code>-s 2,virtio-blk,/dev/da4p2 =
\<o:p></o:p></code></pre><pre><code>-s 3,virtio-blk,/dev/da2p1 =
\<o:p></o:p></code></pre><pre><code><o:p>&nbsp;</o:p></code></pre><pre><c=
ode><o:p>&nbsp;</o:p></code></pre><pre><code>=3D&gt;=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 34=C2=A0 19532873661=C2=A0 da4=C2=A0 =
GPT=C2=A0 =
(9.1T)<o:p></o:p></code></pre><pre><code>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 34=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
32734=C2=A0=C2=A0=C2=A0 1=C2=A0 ms-reserved=C2=A0 =
(16M)<o:p></o:p></code></pre><pre><code>32768=C2=A0 =
19532838912=C2=A0=C2=A0=C2=A0 2=C2=A0 ms-basic-data=C2=A0 =
(9.1T)<o:p></o:p></code></pre><pre><code>19532871680=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 2015=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - =
free -=C2=A0 =
(1.0M)<o:p></o:p></code></pre><pre><code><o:p>&nbsp;</o:p></code></pre><p=
re><code><o:p>&nbsp;</o:p></code></pre><pre><code>=3D&gt;=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 34=C2=A0 23437705149=C2=A0 da2=C2=A0 =
GPT=C2=A0 =
(11T)<o:p></o:p></code></pre><pre><code>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
34=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
2014=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - free -=C2=A0 =
(1.0M)<o:p></o:p></code></pre><pre><code>2048=C2=A0 =
23437701120=C2=A0=C2=A0=C2=A0 1=C2=A0 ms-basic-data=C2=A0 =
(11T)<o:p></o:p></code></pre><pre><code>23437703168=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 2015=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0- free =
-=C2=A0 (1.0M)<o:p></o:p></code></pre></div><p>I've tried also like this =
:<o:p></o:p></p><div><pre><br><code>bhyve -S -c =
sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A =
\<o:p></o:p></code></pre><pre><code>-s 0,hostbridge =
\<o:p></o:p></code></pre><pre><code>-s 1,ahci-hd,/dev/nvd0 =
\<o:p></o:p></code></pre><pre><code>-s 2,virtio-blk,/dev/da4 =
\<o:p></o:p></code></pre><pre><code>-s 3,virtio-blk,/dev/da2 =
\<o:p></o:p></code></pre><pre><code>-s 8,virtio-net,tap4 =
\<o:p></o:p></code></pre><pre><code>-s =
10,hda,play=3D/dev/dsp,rec=3D/dev/dsp =
\<o:p></o:p></code></pre><pre><code>-s 29,fbuf,tcp=3D[0.0.0.0:5904](<a =
href=3D"http://0.0.0.0:5904/" =
target=3D"_blank">http://0.0.0.0:5904/</a>),w=3D1440,h=3D900 =
\<o:p></o:p></code></pre><pre><code>-s 30,xhci,tablet =
\<o:p></o:p></code></pre><pre><code>-s 31,lpc \ =
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0<o:p></o:p></code></pre><pre><code>-l =
bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd =
\<o:p></o:p></code></pre><pre><code>vm4 &lt; /dev/null &amp; sleep 2 =
&amp;&amp; vncviewer =
0:4<o:p></o:p></code></pre></div><p><o:p>&nbsp;</o:p></p><p>and I get =
this error :<o:p></o:p></p><p><o:p>&nbsp;</o:p></p><p><strong><span =
style=3D'font-family:"Calibri",sans-serif'>Assertion failed: (n &gt;=3D =
2 &amp;&amp; n &lt;=3D BLOCKIF_IOV_MAX + 2), function pci_vtblk_proc, =
file /usr/src/usr.sbin/bhyve/pci_virtio_block.c, line =
324.</span></strong><o:p></o:p></p><p>I have also opened a bug request =
below,but no one replied until now. =
<o:p></o:p></p></td></tr></table></div></div></div></div></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'>Use nvme or ahci-hd for da4/da2 and =
see what you get. The whole disk needs to go in there so Windows sees =
the GPT label. The other thing that comes to mind is that FreeBSD has =
hold of the disks and won=E2=80=99t allow them to be inserted, similar =
to issues when passing zvol into guests when =
volmode&lt;&gt;dev.<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'>Cheers,<o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'mso-fareast-language:EN-US'>Jason.</span><o:p></o:p></p></div></=
div></div></div></body></html>
------=_NextPart_000_02EF_01D8427C.02E3EFA0--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?02ee01d8421f$cf723f20$6e56bd60$>