bhyve Bhyve & Belena

Hi All,



Just wondering if anyone has managed to get the standard belena.img installer files to work with bhyve? if so how do you do it? belena will only provide .img files that need to be specifically written to usb keys with their etcher program .. it seems during the process it also sets up some sort of grub environment..

its kind of like you need to install a temporary vm before the actual vm.... and bhyve just won’t have anything to do with it.

maybe there’s some way to boot off usb into a blank yocto image?

idk, any help would be appreciated.

thanks
 
I managed to get the .img file converted without issue, yes im using vm-bhyve however there is no cloud image for belenaOS ...
however i have made some progress in that i can get to the bhyve uefi boot loader, but i cant see any images, or loaders .. so it just hangs .
my only thought here is to try and use pass through and try booting from the usb key its self. /shrug
but I’m not sure how to do that either

thanks!
 
this is what I have sofar..

I convertred the .img file to a .iso file, the process seems to work as i can dd it to a usb and boot up in metal.

vm create -t ubuntu -s 500M test
the template is untouched (basically just adds loader="grub"
vm install test balena.iso
vm start test

Code:
root@sector_001:/data/vm # vm install test balena.iso
Starting test
  * found guest in /data/vm/test
  * booting...

root@/data/vm # vm install test balena.iso
Starting test
  * found guest in /data/vm/test
  * booting...
NAME  DATASTORE  LOADER  CPU  MEMORY  VNC  AUTOSTART  STATE
test  default    grub    1    512M    -    No         Bootloader (60507)

then on tmux in another window Im at grub

Code:
grub>
grub> ls
(cd0) (cd0,msdos6) (cd0,msdos5) (cd0,msdos3) (cd0,msdos2) (cd0,msdos1) (hd0) (h
ost)
grub>

I can see the HD and the 4 dos partitons on the usb image thats mounted as a .iso file.

ls (cd0,msdos1)/
Code:
efi/ balena-image-flasher balenaos.fingerprint config.json device-type.json gru
b/ grub.cfg_internal image-version-info splash/ system-connections/

set prefix=(cd0,1)/grub
set root=(hd0,1)
insmod linux
insmod normal
normal

results:

Code:
Linux version 5.10.43-yocto-standard (oe-user@oe-host) (x86_64-poky-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP PREEM
PT Wed Jun 16 16:00:47 UTC 2021
Command line: console=ttyS0 BOOT_IMAGE=/boot/bzImage root=LABEL=flash-rootA flasher rootwait
x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fffe] usable
BIOS-e820: [mem 0x0000000000100000-0x000000001fffffff] usable
NX (Execute Disable) protection: active
SMBIOS 2.6 present.
DMI: FreeBSD BHYVE, BIOS 13.0 11/10/2020
last_pfn = 0x20000 max_arch_pfn = 0x400000000
Disabled
x86/PAT: MTRRs disabled, skipping PAT initialization too.
CPU MTRRs all blank - virtualized system.
x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
found SMP MP-table at [mem 0x000f0000-0x000f000f]
check: Scanning 1 areas for low memory corruption
Using GB pages for direct mapping
ACPI: Early table checksum verification disabled

---cut

Code:
ALSA device list:
  No soundcards found.
ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
ata1.00: ATAPI: BHYVE SATA DVD ROM, 001, max UDMA/133
ata1.00: configured for UDMA/133
scsi 0:0:0:0: CD-ROM            BHYVE    BHYVE DVD-ROM    001  PQ: 0 ANSI: 5
sr 0:0:0:0: [sr0] scsi3-mmc drive: 0x/0x xa/form2 caddy
cdrom: Uniform CD-ROM driver Revision: 3.20
Freeing unused kernel image (initmem) memory: 14476K
Write protecting the kernel read-only data: 22528k
Freeing unused kernel image (text/rodata gap) memory: 2032K
Freeing unused kernel image (rodata/data gap) memory: 504K
Run /init as init process
Starting version 244.5+
random: fast init done
virtio_net virtio1 enp0s5: renamed from eth0
zram0: detected capacity change from 0 to 251207680
input: PS/2 Generic Mouse as /devices/platform/i8042/serio1/input/input3
tsc: Refined TSC clocksource calibration: 2198.399 MHz
clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1fb04a7f9ba, max_idle_ns: 440795285149 ns
clocksource: Switched to clocksource tsc



root '/dev/disk/by-label/flash-rootA' doesn't exist or does not contain a /dev.

and it hangs on looking for a /dev device ..

so I did manage to get it booting, I think now the problems just with grub.. and or I need to some how make the hd0 image before running it?

cheers
 
root '/dev/disk/by-label/flash-rootA' doesn't exist or does not contain a /dev.

Seems like boot partition should be labeled flash-rootA
You can mount the raw file with mdconfig and check labels names with gpart

Maybe that is part of the setup of that etcher tool that writes de image to an usb drive, it sets labels and whatever is needed on the usb drive. I think u should convert the img to usb and then the usb to raw file.

And also what if u try the uefi bhyve loader instead of grub?
 
I think your probally riight here, from what I have seen the tech that said etcher is not required probally does not understand the boot process of the usb key.. I just wish they would do this work, lol its not really up to the customer to hack their product up :P


I dont think this has anything to do with bhyve or the os/config ..

cheers
 
zader
Did you solve the problem in the meantime?
At the moment I was stopped at the same point as you:
Code:
root '/dev/disk/by-label/flash-rootA' doesn't exist or does not contain a /dev.
What was your method to get balenaos running with bhyve?
Thank you!
 
Back
Top