bhyve vm-bhyve debian.raw efi disk image import on Freebsd 14.4

I have been searching around but I just haven't found the post to crack my problem yet. I need to run a Debian efi .raw image I have converted to .raw ( via qemu img).
I have made a Debian test install using the graphical installer from a .iso for debian13.4 via the vnc so I am comfortable with that part. I just haven't found the trick for booting from established .raw images. It probably has something to do with crafting the linux.conf file in /vm/.templates just right.
Also any advice on locking down VNC over SSH would be amazing if. Thank you.
I will stop here and not ask for a pony.
 
How I got Home Assistant running might give you some ideas to try.

Save this as a template, uefi-boot.conf for example:
Code:
loader="uefi"
uefi_vars="yes"
cpu=1
memory=2048M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_dev="sparse-zvol"
disk0_name="disk0.img"

Then create a VM using this template, or modify your existing VM. Important are loader and uefi_vars, those will get the VM to UEFI boot. You may need to add graphics="yes" because lots of Linux images nowadays don't enable a serial console out-of-the-box. Then simply dd(1) your raw image over that disk0.img "disk" that got created for the VM. Start the VM. It should boot.

Also any advice on locking down VNC over SSH would be amazing if.
Set graphics_listen to 127.0.0.1. That will bind VNC to localhost. Then use SSH port forwarding, -L 5900:localhost:5900 for example. Connect your VNC client to 127.0.0.1:5900.
 
I tip my hat to you SirDice. That worked perfectly. My next VM saw your Home Assistant post previously and I think HA will be the next VM I spin up.
Thank you again.

 
New wrinkle on the same system.
Getting kernel: pid xxxxx (bhyve), jid 0, uid 0, was killed: failed to reclaim memory on a Debian 12 guest running on FreeBSD 14.4-release. It has happened twice while a vendor was ssh'd into the vm and restoring data from an earlier version of their Debian PostgreSQL database.
*Update: Turns out I was starving the host system of RAM. I made a tweak to the bhyve specs and it is running much better now. Thank you to everyone who worked on this very powerful tool.
The database import ran smoothly and we are ready to deploy.
 
Back
Top