churchers / vm-bhyve

Shell based, minimal dependency bhyve manager
BSD 2-Clause "Simplified" License
838 stars 178 forks source link

unable to start second linux vm #557

Open RSX11MPLUS opened 2 months ago

RSX11MPLUS commented 2 months ago

i am having a strange issue that is preventing me from starting more than one linux vm at a time. the configuration i am using is as follows, for debian vms:

loader="uefi"
debug="yes"
cpu="1"
memory="512M"
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0"
disk0_dev="sparse-zvol"

i am able to create the vm and the install command exits successfully, but the vm does not start. i see this in the debug log, but nothing else, and no indication as to why the vm actually exited.

Aug 30 18:44:33: generated static mac 58:9c:fc:0a:61:28 (based on 'scan01:0:1725057873:0')
Aug 30 18:44:37: initialising
Aug 30 18:44:37:  [loader: uefi]
Aug 30 18:44:37:  [cpu: 1]
Aug 30 18:44:37:  [memory: 512M]
Aug 30 18:44:37:  [hostbridge: standard]
Aug 30 18:44:37:  [com ports: com1]
Aug 30 18:44:37:  [uuid: 6d19c021-6721-11ef-9fb7-0cc47a0d7c77]
Aug 30 18:44:37:  [debug mode: yes]
Aug 30 18:44:37:  [primary disk: disk0]
Aug 30 18:44:37:  [primary disk dev: sparse-zvol]
Aug 30 18:44:37: initialising network device tap3
Aug 30 18:44:37: adding tap3 -> vm-public (public addm)
Aug 30 18:44:37: bring up tap3 -> vm-public (public addm)
Aug 30 18:44:37: booting
Aug 30 18:44:37:  [bhyve options: -c 1 -m 512M -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -U 6d19c021-6721-11ef-9fb7-0cc47a0d7c77 -u]
Aug 30 18:44:37:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/dev/zvol/data/vm/scan01/disk0 -s 5:0,virtio-net,tap3,mac=58:9c:fc:0a:61:28]
Aug 30 18:44:37:  [bhyve console: -l com1,stdio]
Aug 30 18:44:37:  [bhyve iso device: -s 3:0,ahci-cd,/data/vm/.iso/debian-12.4.0-amd64-netinst.iso,ro]
Aug 30 18:44:37: starting bhyve (run 1)
Aug 30 18:44:37: bhyve exited with status 4
Aug 30 18:44:37: destroying network device tap3
Aug 30 18:44:37: stopped

i have previously had this issue on 14.0, and now 14.1 as well. storage is zfs. appreciate any insight you can provide, i am pulling my hair out here :)

GogoFC commented 1 month ago

Did you figure this one out? You're missing graphics in your config if you're gonna run uefi and be able to start vnc.

graphics="yes"
xhci_mouse="yes"
graphics_res="1600x900"

That might not be the reason why it exits. You're being very cheap with RAM :) , how much do you have? It's possible that Debian won't run on 512 anymore, give it a 1G. They did up the miminum requirements Memory and Disk Space Requirements As they mention it is possible to install in lowmem mode I would still give it at least 1024M. Although a VM can exit if there's not enough RAM.

And if you meant that you were actually able to go through the installation, with a different config file, but when you rebooted it didn't boot then you're missing efivars in config as Debian's boot loader has always been in a non standard place, unless something changed recently.

So add efivars, here's the config I use.

loader="uefi"
cpu=4
memory=4096M
network0_type="virtio-net"
network0_switch="public"
graphics="yes"
xhci_mouse="yes"
graphics_res="1600x900"
zfs_zvol_opts="volblocksize=128k"
disk0_name="disk0"
disk0_dev="sparse-zvol"
disk0_type="virtio-blk"
uefi_vars="yes"