From nobody Sun Mar 27 21:15:39 2022 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A3C921A43000; Sun, 27 Mar 2022 21:15:49 +0000 (UTC) (envelope-from jason@tubnor.net) Received: from mail.tubnor.net (mail.tubnor.net [103.236.162.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KRTBq5qkjz3FSn; Sun, 27 Mar 2022 21:15:47 +0000 (UTC) (envelope-from jason@tubnor.net) Received: from THEMASTER (119-18-29-78.77121d.mel.static.aussiebb.net [119.18.29.78]) by mel01.ar18.net (OpenSMTPD) with ESMTPSA id cdbdd4a8 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 28 Mar 2022 08:15:37 +1100 (AEDT) From: To: "'Mario Marietto'" , "'FreeBSD virtualization'" , References: In-Reply-To: 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 Date: Mon, 28 Mar 2022 08:15:39 +1100 Message-ID: <02ee01d8421f$cf723f20$6e56bd60$@tubnor.net> List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_02EF_01D8427C.02E3EFA0" X-Mailer: Microsoft Outlook 16.0 Content-Language: en-au Thread-Index: AQNcWSBj7+dauHeS+lvNqOjBTKUtsKnLiseg X-Rspamd-Queue-Id: 4KRTBq5qkjz3FSn X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jason@tubnor.net designates 103.236.162.16 as permitted sender) smtp.mailfrom=jason@tubnor.net X-Spamd-Result: default: False [-1.61 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jason]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:103.236.162.16]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[tubnor.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.31)[-0.310]; FROM_NO_DN(0.00)[]; HTTP_TO_IP(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MLMMJ_DEST(0.00)[hackers,freebsd-virtualization]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:133159, ipnet:103.236.162.0/23, country:AU]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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

 

 

 

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 = :

 
=
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 =
\=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 
-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>=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)
=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)
32768=C2=A0 =
19532838912=C2=A0=C2=A0=C2=A0 2=C2=A0 ms-basic-data=C2=A0 =
(9.1T)
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)
 
 
=3D>=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)
=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)
2048=C2=A0 =
23437701120=C2=A0=C2=A0=C2=A0 1=C2=A0 ms-basic-data=C2=A0 =
(11T)
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)

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 \ =
=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
-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 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.

 

Cheers,

 

Jason.

------=_NextPart_000_02EF_01D8427C.02E3EFA0--