bhyve bhyve and KVM

I am trying to launch an appliance provided by a company as a KVM image (stormshield EVA appliance) but it doesn't boot. I tried to use grub automatically but it goes on its shell. Using UEFI it doesn't start as well. Any idea how to debug the boot. What can prevent the image to start ? How to find the way to boot the image?
 
I've also seen linux appliances for KVM that have been built with minimal drivers, i.e. a KVM-specific kernel. You would need to boot such an VM on KVM and replace the kernel with a generic one, then it *usually* works, maybe with a few more little changes and nudges here and there. Major problem if this is a fully contained appliance: every upgrade might break the VM.

But first check if you have a raw image as covacat already suggested. You can convert qcow2 to raw with qemu-img from emulators/qemu-utils.

At least on smartOS it has been possible to run KVM and bhyve concurrently on the same host for at least 2 years now - I don't know if those patches have been merged (or are possible) on FreeBSD, but you might want to look into that option as a last resort. Although I'd recommend getting it to run on bhyve - the overhead is much lower and VMs on bhyve always feel much snappier than on KVM with the same amount of hardware thrown at the VM.
 
the OS in that appliance is freebsd. But fr some reason I can't load the uefi image...

Code:
BdsDxe: failed to load Boot0001 "UEFI BHYVE SATA DISK BHYVE-C1C1-9552-3683" from PciRoot(0x0)/Pci(0x4,0x0)/Sata(0x0,0xFFFF,0x0): Not Found

the command line is :
Code:
bhyve -c 1 -s 0,hostbridge -s 1,lpc -s 2,virtio-net,tap0 -s 4,ahci-hd,/vms/stm/utm-SNS-EVA-4.3.6-kvm.img -l com1,stdio -A -H -P -m 1G -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd stm
 
if the image is qcow* it won't work regardless the os inside
disk drives wont be correctly emulated (bhyve assumes raw) so probably partition will be garbage, etc
 
I exported the img (from qemu-img convert) on the fs but I still can't boot. I think you're right. Only think I can do is listing the foler. The image is stuck in the bootloader:

Code:
OK ls
/
 d  .snap
 d  data
 d  boot
 d  libexec
    COPYRIGHT
 d  bin
 d  dev
 d  etc
 d  lib
 d  sbin
 d  tmp
 d  usr
 d  var
OK ls boot
boot
 d  kernel
    boot1.efi
    gptboot
    mbr
    loader.efi
    pmbr
    userboot.so
    loader
    boot
 d  lua
 d  defaults
    loader.whitelist
    device.hints
    manifest
    manifest.rcerts
    manifest.rsig
    pass_manifest
    pass_manifest.rcerts
    pass_manifest.rsig
 
don't know exactly what you mean by "export" but usually you can just convert to raw and then dd that raw image directly to the zvol (/dev/zvol/...)

also if this is a freebsd appliance, don't bother playing around with grub (which will break anyways at any given chance...), just use the default/native bhyve UEFI loader.
 
don't know exactly what you mean by "export" but usually you can just convert to raw and then dd that raw image directly to the zvol (/dev/zvol/...)

also if this is a freebsd appliance, don't bother playing around with grub (which will break anyways at any given chance...), just use the default/native bhyve UEFI loader.
So I get a kvm image in qcow2 format. I needed to convert it. Right now I don't really care about grub, I'm just trying to understand why this image don't boot.

I get a boot but then it stops when using such commands (vm-bhyve log):

Code:
Mar 31 14:45:07:  [bhyve options: -c 1 -m 2G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w -U 903235a4-b0ec-11ec-9a63-1402ec690a80 -u]
Mar 31 14:45:07:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/dev/zvol/zroot/<hostname>/vm/stm/disk0 -s 5:0,virtio-net,tap1,mac=58:9c:fc:05:59:6c -s 6:0,fbuf,tcp=[::]:5900]

the console output is the following (only after i type `boot` in the console):

Code:
OK boot
Loading kernel...
/boot/kernel/kernel text=0x6de318 data=0x95f20+0x95a430 syms=[0x8+0xbdc18+0x8+0xbbc32]
Loading configured modules...
can't find '/boot/entropy'
Consoles: userboot

FreeBSD/amd64 User boot lua, Revision 1.2
Loading /boot/defaults/loader.conf
Loading /boot/loader.whitelist
Loading /boot/device.hints
Loading /boot/device.hints.sns
Loading /boot/loader.conf
Loading /boot/loader.conf.local
ERROR: /boot/lua/password.lua:127: attempt to call a nil value (field 'restrictInteractive').

At this point I don't know how to go further :/
 
As a side note to make it working under linux (proxmox) I had to do the folllowing:

* export to zfs
* set the disk type as sata instead of scsi
* change boot order to ensure disk is loaded first.

Can we do the same with bhyve?
 
Back
Top