Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2022 14:32:12 +0200
From:      Mario Marietto <marietto2008@gmail.com>
To:        jason@tubnor.net, =?UTF-8?Q?Corvin_K=C3=B6hne?= <c.koehne@beckhoff.com>
Cc:        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:  <CA%2B1FSihntYCWBZm0EuPmSXq1EmcwdfG%2BVC_RwVgFyukLyS2ARw@mail.gmail.com>
In-Reply-To: <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net>
References:  <CA%2B1FSigxiPPHcE-eig20a6S%2BVEquEwiwG_NvpOahPK3BQh=kng@mail.gmail.com> <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000009711e305db468255
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I've just installed the virtio driver version suggested by Corvin (0.185)
and it works fine in Windows. So,now I can pass those NTFS disks without
using the USB controller. That's so cool. Bhyve becoming even more and more
interesting. I'm happy thanks to everyone. It works even in Linux without
passing the disks using the USB controller. Maybe I can make a lighter
/boot/loader.conf file,excluding the USB controllers.....

Il giorno dom 27 mar 2022 alle ore 23:15 <jason@tubnor.net> ha scritto:

>
>
>
>
>
>
> What I want to achieve is to pass thru two of my NTFS "formatted" disks t=
o
> 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 boo=
t
> Windows 11 from the nvme disk nvd0.
>
> I've configured the bhyve VM 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/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 \
>
> -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 \
>
>
>
>
>
> =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)
>
>
>
>
>
> =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 \
>
> -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 >=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.
>
>
>
> Use nvme or ahci-hd for da4/da2 and see what you get. The whole disk need=
s
> 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 t=
o be
> inserted, similar to issues when passing zvol into guests when volmode<>d=
ev.
>
>
>
> Cheers,
>
>
>
> Jason.
>


--=20
Mario.

--0000000000009711e305db468255
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;ve just installed the virtio driver version suggeste=
d by Corvin (0.185) and it works fine in Windows. So,now I can pass those N=
TFS disks without using the USB controller. That&#39;s so cool. Bhyve becom=
ing even more and more interesting. I&#39;m happy thanks to everyone. It wo=
rks even in Linux without passing the disks using the USB controller. Maybe=
 I can make a lighter /boot/loader.conf file,excluding the USB controllers.=
....<br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmai=
l_attr">Il giorno dom 27 mar 2022 alle ore 23:15 &lt;<a href=3D"mailto:jaso=
n@tubnor.net" target=3D"_blank">jason@tubnor.net</a>&gt; ha scritto:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang=3D"EN-AU"><d=
iv><p class=3D"MsoNormal"><span><u></u>=C2=A0<u></u></span></p><p class=3D"=
MsoNormal"><span><u></u>=C2=A0<u></u></span></p><div style=3D"border-color:=
currentcolor currentcolor currentcolor blue;border-style:none none none sol=
id;border-width:medium medium medium 1.5pt;padding:0cm 0cm 0cm 4pt"><div><d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><div><div id=
=3D"gmail-m_1193725023651875727gmail-m_-4915200597164754434gmail-m_-5563554=
548007041422gmail-issue-1172720202"><div><div><table cellpadding=3D"0" bord=
er=3D"0"><tbody><tr><td style=3D"padding:0.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 fro=
m the nvme disk nvd0.<u></u><u></u></p><p>I&#39;ve configured the bhyve VM =
like this :<u></u><u></u></p><div><pre><code><u></u>=C2=A0<u></u></code></p=
re><pre><code>bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A =
\<u></u><u></u></code></pre><pre><code>-s 0,hostbridge \<u></u><u></u></cod=
e></pre><pre><code>-s 1,ahci-hd,/dev/nvd0 \<u></u><u></u></code></pre><pre>=
<code>-s 2,virtio-blk,/dev/da4p2 \<u></u><u></u></code></pre><pre><code>-s =
3,virtio-blk,/dev/da2p1 \<u></u><u></u></code></pre><pre><code>-s 8,virtio-=
net,tap4 \<u></u><u></u></code></pre><pre><code>-s 10,hda,play=3D/dev/dsp,r=
ec=3D/dev/dsp \<u></u><u></u></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 \<u></u><u></u></code></pre><pre><code>-s 30,x=
hci,tablet \<u></u><u></u></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 <u></=
u><u></u></code></pre><pre><code>-l bootrom,/usr/local/share/uefi-firmware/=
BHYVE_BHF_CODE.fd \<u></u><u></u></code></pre><pre><code>vm4 &lt; /dev/null=
 &amp; sleep 2 &amp;&amp; vncviewer 0:4<u></u><u></u></code></pre></div><p>=
<u></u>=C2=A0<u></u></p><p>These are the NTFS disks that I would like to se=
e inside the Windows 11 guest os :<u></u><u></u></p><div><pre><br><code>-s =
2,virtio-blk,/dev/da4p2 \<u></u><u></u></code></pre><pre><code>-s 3,virtio-=
blk,/dev/da2p1 \<u></u><u></u></code></pre><pre><code><u></u>=C2=A0<u></u><=
/code></pre><pre><code><u></u>=C2=A0<u></u></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)<u></u><u></u></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 (16=
M)<u></u><u></u></code></pre><pre><code>32768=C2=A0 19532838912=C2=A0=C2=A0=
=C2=A0 2=C2=A0 ms-basic-data=C2=A0 (9.1T)<u></u><u></u></code></pre><pre><c=
ode>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)<u></u><u></u></code></=
pre><pre><code><u></u>=C2=A0<u></u></code></pre><pre><code><u></u>=C2=A0<u>=
</u></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)<u></u><u></u=
></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)<u></u><u></u></code></=
pre><pre><code>2048=C2=A0 23437701120=C2=A0=C2=A0=C2=A0 1=C2=A0 ms-basic-da=
ta=C2=A0 (11T)<u></u><u></u></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)<u></u><u></u></code></pre></div><p>I&#39;ve tried =
also like this :<u></u><u></u></p><div><pre><br><code>bhyve -S -c sockets=
=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \<u></u><u></u></code></pre><pre>=
<code>-s 0,hostbridge \<u></u><u></u></code></pre><pre><code>-s 1,ahci-hd,/=
dev/nvd0 \<u></u><u></u></code></pre><pre><code>-s 2,virtio-blk,/dev/da4 \<=
u></u><u></u></code></pre><pre><code>-s 3,virtio-blk,/dev/da2 \<u></u><u></=
u></code></pre><pre><code>-s 8,virtio-net,tap4 \<u></u><u></u></code></pre>=
<pre><code>-s 10,hda,play=3D/dev/dsp,rec=3D/dev/dsp \<u></u><u></u></code><=
/pre><pre><code>-s 29,fbuf,tcp=3D[0.0.0.0:5904](<a href=3D"http://0.0.0.0:5=
904/" target=3D"_blank">http://0.0.0.0:5904/</a>),w=3D1440,h=3D900 \<u></u>=
<u></u></code></pre><pre><code>-s 30,xhci,tablet \<u></u><u></u></code></pr=
e><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<u></u><u></u></code></pre><pre><code>-l b=
ootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_CODE.fd \<u></u><u></u></co=
de></pre><pre><code>vm4 &lt; /dev/null &amp; sleep 2 &amp;&amp; vncviewer 0=
:4<u></u><u></u></code></pre></div><p><u></u>=C2=A0<u></u></p><p>and I get =
this error :<u></u><u></u></p><p><u></u>=C2=A0<u></u></p><p><strong><span s=
tyle=3D"font-family:&quot;Calibri&quot;,sans-serif">Assertion failed: (n &g=
t;=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>=
<u></u><u></u></p><p>I have also opened a bug request below,but no one repl=
ied until now. <u></u><u></u></p></td></tr></tbody></table></div></div></di=
v></div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=
=3D"MsoNormal"><span>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 othe=
r 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.<u></u><u></u></span></p><p class=3D"MsoNor=
mal"><span><u></u>=C2=A0<u></u></span></p><p class=3D"MsoNormal"><span>Chee=
rs,<u></u><u></u></span></p><p class=3D"MsoNormal"><span><u></u>=C2=A0<u></=
u></span></p><p class=3D"MsoNormal"><span>Jason.</span><u></u><u></u></p></=
div></div></div></div></div></blockquote></div><br clear=3D"all"><br>-- <br=
><div dir=3D"ltr">Mario.<br></div>

--0000000000009711e305db468255--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSihntYCWBZm0EuPmSXq1EmcwdfG%2BVC_RwVgFyukLyS2ARw>