Solved bhyve (via vm) guest no longer starts - bhyve exited with status 4

I don't think nmdm was ever a part of the GENERIC kernel but I haven't checked.
It's a kmod and I see that in my code:
Code:
if ! $(kldstat -qm nmdm); then
        kldload nmdm
fi
It should be the job of vm-bhyve to get the things right.
But again, what is the purpose to have grub and a serial console in this case?
 
I don't think nmdm was ever a part of the GENERIC kernel but I haven't checked. But if you're asking why whatever you used before nmdm doesn't work anymore, I've no idea!

I found nothing recent at cgit.freebsd[.]org/src/log/?h=stable%2F15&qt=grep&q=nmdm
 
I like your articles. They inspired me for many FreeBSD tasks.
Chaos strikes* more and more often. We must face to this.

As an example, I used since many years a debian VM for the wifi connection on my home server. I started with GRUB and nmdm console. But at a time, I felt it was time to wipe out this past. Hence, the use of UEFI. I left many problems behind me (but got new ones, for sure, lol).

What I mean, it's I realized that past technologies I liked so much are going to disappear. You have to move or die. FreeBSD (as other OSes) will less and less support old technologies. We have no choice, but to move ahead.

(*) If you see there an Atari game, you're right. It just lacks "back".
 
Setting where? I tried /usr/local/vm/hass2/hass2.conf and then

Yeah, in your VM's configuration file. Once you've set debug=YES, vm-bhyve should log bhyve's output to the bhyve.log file (in the same directory as vm-bhyve.log).

In your vm-bhyve.log file should indicate that the debug level is enabled:

...
2026-04-26T12:38:07+00:00: [debug mode: YES]
...
 
Do you have nmdm loaded?
Yes. I read what you tried. I don't use vm. My bhyve script:
Code:
bhyve -c 1 \
        -s 0,hostbridge \
        -s 5,nvme,haos.img \
        -s 10,virtio-net,tap3,mac=xx:xx:xx:xx:xx:xx \
        -s 20,xhci,tablet \
        -s 31,lpc \
        -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
        -s 11,fbuf,tcp=0.0.0.0:5902,w=1920,h=1080 \
        -l com1,/dev/nmdm2B \
        -m 2G -H \
        haos
Using mdconfig I created a md device and looked at the structure of the .img file:
Code:
# mdconfig -a -t vnode -f haos.img
md0
# gpart show md0
=>      34  12582845  md0  GPT  (6G)
        34      2014       - free -  (1007K)
      2048     65536    1  efi  (32M)
     67584     49152    2  linux-data  (24M)
    116736    524288    3  linux-data  (256M)
    641024     49152    4  linux-data  (24M)
    690176    524288    5  linux-data  (256M)
   1214464     16384    6  linux-data  (8M)
   1230848    196608    7  linux-data  (96M)
   1427456   2621440    8  linux-data  (1G)
   4048896   8533983       - free -  (4G)
From ha console (accessed via VNC) I see it is running in a docker. I haven't read your blog yet & may not play with HA for a day or two so this is about as far as I got.
 
Using mdconfig I created a md device and looked at the structure of the .img file:
My blog post does not mention creating my file. However, I see this now:

Code:
[16:53 r730-01 dvl /usr/local/vm/hass] % sudo file disk0.img
disk0.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 67108863 sectors, extended partition table (last)
 
Back
Top