qemu FreeBSD13 won't boot in qemu-kvm host

So after solving this UEFI issue Thread 515110 I'd like to move over to qemu-kvm on the Linux host. I have qemu-kvm working properly and OVMF installed and enabled to support UEFI.

The FreeBSD13 iso boots fine and installs. But then booting the guest freezes. It happens while registering the internal USB hub (I'm testing on a laptop), but I don't know if that's specifically what's causing the freeze.

Any thoughts on what to look for?
 
Without offend you, qemu-kvm+Linux is a recipe for disaster
I tell you for personal experience,Linux take control over until the point that is imposible
respond to "why everything is slow?" "why my vm takes 1 hour to start?"
and debug today a Linux machine is a pain in the ass

my advice, use FreeBSD , use only one or 2 cpu to the VM and give low priority with idprio or rtprio
for give resources to the server
you got Bhyve or Virtualbox , both are easy to setup and mantain
 
I don't have any physical Linux I can test it on right now. I've osx, I tried it there. I can't test kvm part which may be an interesting part.
I was able to install and run the FreeBSD guest. My run command:
Code:
qemu-system-x86_64 -m 1024 -bios OVMF-pure-efi.fd -serial stdio \
    -device virtio-blk-pci,drive=hd0 -drive if=none,id=hd0,format=qcow2,file=disk00.qcow2  \
    -device virtio-net-pci,netdev=net0 \
    -netdev user,id=net0,hostfwd=tcp::60100-:22,ipv6=off
 
I have successfully installed from FreeBSD-13.0-RELEASE-amd64-bootonly.iso and booted into the ZFS based installation on my qemu/kvm guest using OVMF/UEFI firmware.

One of the tricky point for me is that when creating the VM using virt-manager, the default template for FreeBSD 12 includes a serial console device. The installer boot loader recognises that and offer "Cons: Dual (Serial Primary)" as the default option. This creates the first problem that the installer seems to stall midway during boot at the prompt around "lo0: link state changed to UP" on the graphical output. At that point, I need to switch to "Text Console 1" to complete the installation. The installation completes without issue using default options with root on ZFS.

Upon rebooting into the ZFS based installation, I noticed the boot loader still defaults to the "Cons: Dual (Serial Primary)"; which pose no issue, but sm-mta and sm-msp-queue initialisation tried verifying the hostname against DNS entry and that cause around 2 minutes of delay before it was able to continue to the login prompt.

To work around the issue, I believe you can change the default console to "Cons: Video" at the boot loader by pressing "5" several times. Or by removing the "Serial 1" device from your VM devices. While I don't guarantee that everything will work in your case, having a working console should give more hints on further troubleshooting. Also, the default virt-manager template for FreeBSD includes some hardware that might not be essential to you usage, you may also try removing some of those if the aforementioned workaround is of no help. As a side note, I'm presenting VirtIO devices to the VM for both disks and NIC and both have work perfectly since at least FreeBSD 11 so you should probably use VirtIO devices in case you were having trouble using other emulated devices.

Cheers.
 
Back
Top