bhyve How to start virtual machine

I created a virtual ubuntu 26.04 machine with vm, I run console ubuntu, it shows OK. I got an error message "can't load kernel" after input boot. What to do next? How to start it and get a graphical desktop?
 
Is this one?
Code:
loader="bhyveload"
cpu=1
memory=1024M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
uuid="61da34de-2ba3-42b8-ab7f-d6096cb0f9cd"
network0_mac="58:9c:fc:03:51:90"
 
Is this one?
Code:
loader="bhyveload"
cpu=1
memory=1024M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
uuid="61da34de-2ba3-42b8-ab7f-d6096cb0f9cd"
network0_mac="58:9c:fc:03:51:90"
You should probably use uefi loader instead of bhyveload(8) one.

And if you want a graphical desktop, make sure you have appropriate settings for that, for instance:
Code:
loader="uefi"
uefi_vars="yes"
graphics="yes"
graphics_res="1920x1080"
graphics_post="5900"
xhci_mouse="yes"

Then run
Code:
vm start <ubuntu2604-vm-name>
After that you can use VNC viewer (for instance net/tigervnc-viewer to connect to that VM and get the graphical experience:
Code:
vncviewer 127.0.0.1:5900

We use port 5900, because this is what we specified in our config above as graphics_post. You can use whatever port you like.
 
after input vncviewer 127.0.0.1:5900, I got a screen
Code:
BdsDxe: failed to load Boot001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x4,0x0): Not found

BdsDxe: No bootable option or device was found

BdsDxe: Press any key to enter the Boot Manager Menu
can't continue, what to do next?
 
after input vncviewer 127.0.0.1:5900, I got a screen
Code:
BdsDxe: failed to load Boot001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x4,0x0): Not found

BdsDxe: No bootable option or device was found

BdsDxe: Press any key to enter the Boot Manager Menu
can't continue, what to do next?
Oh, yeah I remember I had something very similar with my Ubuntu 26.04 VM. Take a look at this issue, this is where I found a solution for myself, I believe it should work for you as well.
 
Simplest solution, destroy this VM, recreate it with the UEFI boot settings and reinstall. The installer will take proper care of the UEFI boot settings.
 
after input vncviewer 127.0.0.1:5900, I got a screen
Code:
BdsDxe: failed to load Boot001 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x4,0x0): Not found

BdsDxe: No bootable option or device was found

BdsDxe: Press any key to enter the Boot Manager Menu
can't continue, what to do next?
Probably Ubuntu choose a non-standard name for its UEFI loader (the .efi file in the EFI partition), and since UEFI variables support was not enabled (the uefi_vars="yes" entry in your VM config file) the UEFI firmware is looking for a loader with a standard name.

You have two choices:
  • Boot your VM and access the UEFI firmware, then choose the boot loader file, and after the OS has booted up use efibootmgr(8) to create a proper entry.
  • As SirDice said, just reinstall the VM with UEFI as loader and with UEFI variables support enabled.
 
Bhyve on Freebsd with Podman and Invidious


Here are my notes on installing Ubuntu in a bhyve vm

disk0_type="nvme" fixes the uefi issue


Code:
# =====================================================================
# ubuntu
# =====================================================================

loader="uefi"
cpu="4"
memory="4G"
network0_type="virtio-net"
network0_switch="public"

# =====================================================================
# Switch from file image to sparse Zvol block storage
# =====================================================================
disk0_type="nvme"
disk0_name="disk0"
disk0_dev="sparse-zvol"

# =====================================================================
# System context lines
# =====================================================================

utctime="yes"
virt_random="yes"
graphics="yes"
xhci_mouse="yes"
graphics_res="1920x1080"
uefi_vars="yes"

root dotfiles


Vermadens page suggests using a raw file instead of a zfs sparse image for performance

 
thanks, I had installed ubuntu 26.04 successfully.
But thers's no internet connection, I can only use wired connection(not supported wifi driver or someting), I only have wifi.
Any solutions?
 
ifconfig show I have lo0 wlan0 vm-public and tap0(acvtive), which one should I use to replace em0?
my vm switch list shows port wlan0, above post shows no port.
 
Back
Top