bhyve Making correct conf bhyve working, vm-bhyve not.

Hi
I am trying to do a Debian installation on bhyve, and would like to use the tool vm-bhyve.
The problem is that I cannot connect from VNC after "vm install" and after a while I get the following error:
Code:
Starting debian1
   * found guest in /zroot/vm/debian1
   * booting...
usage: bhyveload [-S][-c <console-device>] [-d <disk-path>] [-e <name=value>] [-h <host-path>] [-m memsize[K|k|M|m|G|g|T|t]] <vmname>
My debian.conf look like this:
Code:
loader="bhyveload"
uefi_vars="yes"
bhyveload_loader="/usr/local/share/uefi-firmware/BHYVE_BHF_UEFI.fd"
bhyveload_args="fwcfg=qemu"
cpu=2
memory=2048M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
graphics="yes"
graphics_port="5900"
graphics_listen="0.0.0.0"
graphics_res="1024x768"
graphics_wait="auto"
xhci_mouse="yes"
If I don't use vm, and use the configuration below everything works as it should.
Code:
bhyve \
-c sockets=1,cores=2,threads=1 \
-m 2G \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_UEFI.fd,fwcfg=qemu \
-s 0,hostbridge \
-s 2,fbuf,rfb=0.0.0.0:5900,w=1024,h=768 \
-s 3,xhci,tablet \
-s 10,nvme,/usr/home/Administrator/vm/debian1/disk0.img \
-s 15,ahci-cd,/usr/home/Administrator/vm/debian1/distro.iso,ro \
-s 20,virtio-net,tap0 \
-s 31,lpc \
-H -P -A \
How to convert configuration above to a correct vm configuration file.
 

Attachments

  • debian.conf.jpg
    debian.conf.jpg
    79.7 KB · Views: 44
could you try to use bhyve_options instead of bhyveload_args ... edit: and I have completely overseen "bhyveload" as mentioned by Emrion below
 
could you try to use bhyve_options instead of bhyveload_args ... edit: and I have completely overseen "bhyveload" as mentioned by Emrion below
Sure - It doesn't work, but it could also be that I'm using the option parameter incorrectly!
I have written:

bhyve_options ="-l fwcfg=qemu"
 
In the directory where the VM is set up (probably something like /vm/<name>/), you'll find a vm-bhyve.log. That log file has the exact command line it used to start the VM. There's probably an option in there that's not correct.
 
You won't make a Debian boots with loader="bhyveload". Use UEFI instead as you did with bhyve: loader="uefi" vm(8).
If I just use uefi it stops booting ringht away. That was the reason i point to my uefi file.

# vm create -t debian -s 20G debian1
# vm install -f debian1 alpine-standard-3.15.6-x86_64.iso
Starting debian1
* found guest in /zroot/vm/debian1
* booting...
#
 
In the directory where the VM is set up (probably something like /vm/<name>/), you'll find a vm-bhyve.log. That log file has the exact command line it used to start the VM. There's probably an option in there that's not correct.
Tx for the hint :)
But until now iI do not found the reason...
I have also set debug="yes" but i cannot find the extra log file.
Code:
Jan 17 15:00:10: initialising
Jan 17 15:00:10:  [loader: bhyveload]
Jan 17 15:00:10:  [cpu: 1,sockets=1,cores=2,threads=1]
Jan 17 15:00:10:  [memory: 2048M]
Jan 17 15:00:10:  [hostbridge: standard]
Jan 17 15:00:10:  [com ports: com1]
Jan 17 15:00:10:  [uuid: 17004c37-b549-11ee-9278-0001057b0579]
Jan 17 15:00:10:  [debug mode: yes]
Jan 17 15:00:10:  [primary disk: disk0.img]
Jan 17 15:00:10:  [primary disk dev: file]
Jan 17 15:00:10: initialising network device tap0
Jan 17 15:00:10: adding tap0 -> vm-public (public addm)
Jan 17 15:00:11: bring up tap0 -> vm-public (public addm)
Jan 17 15:00:11: booting
Jan 17 15:00:11: bhyveload -m 2048M -e autoboot_delay=3 fwcfg=qemu -l /usr/local/share/uefi-firmware/BHYVE_BHF_UEFI.fd -d /zroot/vm/.iso/alpine-standard-3.15.6-x86_64.iso debian1
Jan 17 15:00:11: fatal; loader returned error 1
Jan 17 15:00:11: destroying network device tap0
Jan 17 15:00:12: stopped
 
The fwcfg=qemu doesn't seem right, it's not in the correct position.

Not sure if it's the correct solution but try setting this:
Code:
bhyveload_loader="bootrom,/usr/local/share/uefi-firmware/BHYVE_BHF_UEFI.fd,fwcfg=qemu"
And remove that bhyveload_args="fwcfg=qemu" line.
 
Change this:

Code:
loader="bhyveload"

For this:

Code:
loader="uefi"

Delete the other options related with bhyveload.

Debian have a little problem in its UEFI loader, this forces you to change the location of the UEFI files, something easy to do and well explained in this post.

This changes you can make it from the UEFI shell.
 
This article, in my opinion, is a little clearer than the link ArgentoSoma gave (or maybe I'm just dumber and needed a more detailed explanation) but it tells you how to fix it if you've used uefi and then it won't boot properly.
 
It shouldn't be a problem with UEFI vars because he set uefi_vars="yes".

I didn't see that he made bhyveload uses another loader than itself with bhyveload_loader="/usr/local/share/uefi-firmware/BHYVE_BHF_UEFI.fd". It's somewhat peculiar but...

I don't think it's a bug with vm-bhyve. So yes, the most probable is a problem with fwcfg=qemu. I don't use vm-bhyve so I can't be sure what to do for that. Maybe bhyve_option, maybe not.

And FWI, FreeBSD now also uses a "non-standard efi loader place" as Debian (/efi/freebsd/loader.efi).
 
Back
Top