Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2022 00:31:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 262113] bhyve fails every other attempt to run
Message-ID:  <bug-262113-27103@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262113

            Bug ID: 262113
           Summary: bhyve fails every other attempt to run
           Product: Base System
           Version: 13.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bhyve
          Assignee: virtualization@FreeBSD.org
          Reporter: risner@stdio.com

using an UEFI OS and the commands executed below, you may start bhyve.
Regardless of the way you exit (ctrl-c, halt or reboot from inside the vm);
when you retry you will get an invalid argument error. Retrying immediately
after, it works. The cycle then repeats.

bhyvectl --destroy --vm=3Dtest0
bhyve -AHP -c 1 -m 1024M -S -s 0,hostbridge -s 1,lpc -l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 3,ahci-hd,efiboot.i=
mg
-s 29,fbuf,tcp=3D203.0.113.46:5900,w=3D800,h=3D600 test0

>From testing modifications to bhyve, the libvmmapi, and the kernel module I
found that line 1006 of bhyverun.c calls vm_create and returns with EEXIST
despite there being no entry in /dev/vmm and having ran bhyvectl --destroy
immediately before bhyve.

I could not conclusively prove what exactly is going on inside the kernel
module.

It fails on FreeBSD-13 p4 and p7. It failed on two different Cisco amd64
systems I had.

If you don't have a testing OS with uefi, you can make a temporary one with
this:
dd if=3D/dev/zero of=3Defiboot.img bs=3D300m count=3D1
mdconfig -a -t vnode -f efiboot.img
gpart create -s gpt md0
gpart add -t efi -s 256m md0
newfs_msdos -F 32 -c 1 -m 0xf8 /dev/md0p1 # format efi
mount -t msdosfs /dev/md0p1 /mnt
mkdir -p /mnt/EFI/BOOT
wget -O /mnt/EFI/BOOT/BOOTX64.efi
https://sourceforge.net/projects/supergrub2/files/2.04s1/super_grub2_disk_2=
.04s1/super_grub2_disk_standalone_x86_64_efi_2.04s1.EFI/download
umount /mnt
mdconfig -d -u 0

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262113-27103>