bhyve The DHCP server in bhyve, can it pass PXE options to the guest?

How much control do we have over dhcp in bhyve?

Can I make it pass PXE options?
That sure is possible in bhyve(8) (example options: 34.10.1. Setting Up the PXE Environment, 34.10.2. Configuring the DHCP Server ).

I was able to run a PXE / dhcp server and clients, but since sysutils/edk2 (amd64) was upgraded [1] from version g202308_5 , there is no PXE boot option in tianocore anymore [2].

This seems to be a bug, since riscv64 is also affected ([Bug]: The PXE boot option is missing on RISCV64 #12095 from Jan 30. 2026).

Didn't try non-UEFI.


[1] /var/log/messages*: Jan 14 21:32:14 ***** pkg[15079]: edk2-bhyve upgraded: g202308_5 -> g202508

[2]

tianocore-nopxe.png



emulators/virtualbox-ose-72 in comparison, PXE booting works fine:

tianocore-virtualbox.png
 
I have PXE running on servers, but how do I configure the in-bhyve dhcp server? What exactly is it built into?
 
how do I configure the in-bhyve dhcp server
Perhaps I misunderstand the issue, but I could find no mention of an (built-in) "in-bhyve dhcp server" in either the documentation or the source code.

When I was talking about a dhcp server in bhyve(8), I meant a 3rd party application installed in a FreeBSD guest.
 
As far as I know, bhyve doesn't have a built-in PXE/DHCP service. You can configure an external service. For example, this method generates cloud images for a CBSD library (there may be information here that will be useful even without a CBSD). As for guests, you can use the UEFI/EDK2 firmware from ports with HTTP/PXE boot support or use ReFIND (CBSD supports both methods).
 
Unfortunately all my attempts to do PXE boot in bhyve have failed. Bhyve only has uefi now, and it doesn't contain any PXE implementation. You can bring up iPXE, but that one refuses to accept dhcp reply network packages for reasons unknown.
I was able to run a PXE / dhcp server and clients, but since sysutils/edk2 (amd64) was upgraded [1] from version g202308_5 , there is no PXE boot option in tianocore anymore [2].
This issue was bothering me for some time now, but I hadn't the time to test. Since sysutils/edk2 was upgraded from tianocore version g202308_5 to g202508, PXE booting was possible no more.

Luckily I found on https://pkg.ghostbsd.org/ an version g202308_5 package . I haven't it tested, but one could also checkout any pre-g202508 port git commit and build from ports.

This is how to re-enable PXE boot on bhyve(8) (tested on 15.0-Release host and bhyve clients). Assuming "34.10. Diskless Operation with PXE" is configured:

Fetch https://pkg.ghostbsd.org/unstable/FreeBSD:14:amd64/latest/All/edk2-bhyve-g202308_5.pkg (or from attached file down below), unpack package, add "bootrom" bhyve(8) option to PXE client VM configuration. The OSVERSION "FreeBSD:14" doesn't matter, the firmware is supported just fine on "FreeBSD:15".

Example use of the firmware from command line:
Code:
 # bhyve  .... -o bootrom=/tmp/usr/local/share/edk2-bhyve/BHYVE_UEFI.fd  <vm_name>

From a bhyve startup script: pxeboot-example.sh
Code:
 ...
-l bootrom,/tmp/usr/local/share/edk2-bhyve/BHYVE_UEFI.fd \

From a sysutils/vm-bhyve vm configuration file:
Code:
loader="uefi"
...
bhyve_options="-l bootrom,/tmp/usr/local/share/edk2-bhyve/BHYVE_UEFI.fd"

Note: Attached edk2 package and video file are renamed with a .txt suffix, to be able to upload here in forums.
 

Attachments

Back
Top