RE: Virtio-win driver (virtio-blk and virtio-scsi) don't work when they are used on bhyve with Windows 11 as guest os

From: Corvin Köhne <C.Koehne_at_beckhoff.com>
Date: Mon, 28 Mar 2022 12:59:32 UTC
Hi Mario,

> Maybe I can make a lighter /boot/loader.conf file,excluding the USB controllers.....

You can always exclude pptdevs from /boot/loader.conf.
Sadly, it’s nowhere documented properly.
FreeBSD is able to switch to the ppt driver at runtime.


  1.  Remove the pptdevs line from /boot/loader.conf
  2.  Reboot your system
  3.  “devctl detach pci0:0:20:0”
  4.  “devctl set driver pci0:0:20:0 ppt”
  5.  “bhyve … -s 20,passthru,0/20/0 … vmname”

Sometimes it’s possible to successfully reattach a driver:


  1.  “bhyve … -s 20,passthru,0/20/0 … vmname”
  2.  “bhyvectl --destroy --vm=vmname”
  3.  “devctl detach pci0:0:20:0”
  4.  “devctl set driver pci0:0:20:0 xhci”


Best regards
Corvin


Beckhoff Automation GmbH & Co. KG | Managing Director: Dipl. Phys. Hans Beckhoff
Registered office: Verl, Germany | Register court: Guetersloh HRA 7075