[Bug 262936] bhyve randomly fails to boot/stop/reboot

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 30 Mar 2022 10:44:42 UTC

            Bug ID: 262936
           Summary: bhyve randomly fails to boot/stop/reboot
           Product: Base System
           Version: 13.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bhyve
          Assignee: virtualization@FreeBSD.org
          Reporter: bergerkos@yahoo.co.uk

THe system is 13.0-STABLE FreeBSD 13.0-STABLE #0 stable/13-n249491-be8e341777c
(installed from one of the snapshots)

My Windows 10 VM randomly fails to boot (bhyve console hangs dead), after which
it cannot be started again without the machine reboot.
I have passthrough network and USB cards, so may be related, maybe not.

What happens in detail:
SOMETIMES boot console hangs dead at UEFI booting stage, after which `bhyvectl
--vm $my_vm --force-reset / --force-poweroff` commands don't work at all. Boot
console itself hangs and so does the corresponding 'bhyve' process. The `bhyve
--vm $myvm --destroy` command DOES something: ls /dev/vmm is empty, VM
destroyed, but the `bhyve` process is still hanging there. It disappears upon
user logout/login (desktop). 

But when, after these manipulations, I try to start the VM anew it gives off
this error:
bhyve: Failed to map MSI-X table BAR on 12/0/0: Device busy
bhyve: failed to initialize BARs for PCI 12/0/0
device emulation initialization error: Device busy

Here is my command:
bhyve -S -c sockets=1,cores=4,threads=2 -m 8G -H -w \
  -s 0,hostbridge \
  -s 3,passthru,8/0/0 \
  -s 4,virtio-blk,/bhyve/win-alt.img,sectorsize=512/4096 \
  -s 6,hda,rec=/dev/dsp,play=/dev/dsp \
  -s 8,passthru,12/0/0 \
  -s 29,fbuf,tcp=,w=1600,h=900,wait \
  -s 30,xhci,tablet \
  -s 31,lpc \
  -l com1,stdio \
  -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \

Is there anything else that can be "reset" there without a complete machine

You are receiving this mail because:
You are the assignee for the bug.