Page MenuHomeFreeBSD

bhyveload: note that newer FreeBSD is explicitly not supported
AcceptedPublic

Authored by kevans on Sep 4 2026, 1:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 7, 2:33 AM
Unknown Object (File)
Sat, Oct 3, 9:27 PM
Unknown Object (File)
Thu, Oct 1, 8:33 AM
Unknown Object (File)
Wed, Sep 30, 5:27 AM
Unknown Object (File)
Tue, Sep 29, 7:07 AM
Unknown Object (File)
Tue, Sep 29, 7:07 AM
Unknown Object (File)
Mon, Sep 28, 5:03 AM
Unknown Object (File)
Wed, Sep 23, 2:10 PM

Details

Reviewers
michaelo
rew
ziaee
markj
Group Reviewers
bhyve
manpages
Summary

If it works, that's fine, but we can't support being able to load
arbitrarily newer FreeBSD versions because of how this is designed. We
don't really want to advocate for using a newer userboot with older
bhyveload in the general case to be safe, so just call it out as
unsupported.

PR: 274689, 273099

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 76494
Build 73377: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Sep 4 2026, 1:45 PM
This revision is now accepted and ready to land.Sep 4 2026, 3:19 PM

@kevans Anything holding your off applying it?

@kevans Anything holding your off applying it?

I was going to see if bhyve folks wanted to object. Techncally we could write up how to do it because we have a versioning scheme for the protocol, but my concerns are:

  1. Nobody tests these combinations, so no one will really catch if we did break it somehow, and
  2. We need a lot more words to describe securely grabbing a proper userboot, because we can't just say "grab it from your guest image if you trust that it hasn't been modified by the guest"

Though, as I write the last point, the damage that could be done is pretty limited these days. bhyveload will be sandboxed before the custom loader gets fdlopen'd. If we *do* want to suggest that, we just want to advocate for not overwriting the host /boot/userboot.so with it (i.e., always stash it somewhere and use bhyveload -l so that we don't need to hold a /boot dirfd to limit its resources to whatever guest code would normally have accessible)

Just to make sure I understand: we are saying that one can't expect to load and boot a new FreeBSD kernel with an old bhyveload+userboot.so? Or is it old bhyveload and newer userboot.so? I see that one reason for this is that userboot.so might not recognize some ZFS features used in a newer VM image. Are there other reasons?

P.S., I plan to move bhyveload's functionality into bhyve(8) itself.

Just to make sure I understand: we are saying that one can't expect to load and boot a new FreeBSD kernel with an old bhyveload+userboot.so? Or is it old bhyveload and newer userboot.so? I see that one reason for this is that userboot.so might not recognize some ZFS features used in a newer VM image. Are there other reasons?

Old bhyveload + old userboot.so, purely because the version of stand/ the latter builds against.

P.S., I plan to move bhyveload's functionality into bhyve(8) itself.

Oh? Presumably the current userboot protocol would be maintained, or do you have another idea in mind there?

Just to make sure I understand: we are saying that one can't expect to load and boot a new FreeBSD kernel with an old bhyveload+userboot.so? Or is it old bhyveload and newer userboot.so? I see that one reason for this is that userboot.so might not recognize some ZFS features used in a newer VM image. Are there other reasons?

Old bhyveload + old userboot.so, purely because the version of stand/ the latter builds against.

Ok, that makes sense.

P.S., I plan to move bhyveload's functionality into bhyve(8) itself.

Oh? Presumably the current userboot protocol would be maintained, or do you have another idea in mind there?

Unprivileged bhyve doesn't work with bhyveload today, as that needs the VM to be created and executed by a single process. I'd still use userboot, I just want to have all of the functionality in one executable. I also want to be able to boot a kernel directly without a bootloader. I think we'll want to support different "flavours" of vCPU initialization in order to support these different usecases.

Oh? Presumably the current userboot protocol would be maintained, or do you have another idea in mind there?

Unprivileged bhyve doesn't work with bhyveload today, as that needs the VM to be created and executed by a single process. I'd still use userboot, I just want to have all of the functionality in one executable. I also want to be able to boot a kernel directly without a bootloader. I think we'll want to support different "flavours" of vCPU initialization in order to support these different usecases.

Ahh, right. ISTR that Rob Norris had a prototype that added Linux kernel booting to bhyve, or something to that effect. I wonder if he has anything salvageable here? I think he was abstracting it away so that it could be made to work with something like this.

Oh? Presumably the current userboot protocol would be maintained, or do you have another idea in mind there?

Unprivileged bhyve doesn't work with bhyveload today, as that needs the VM to be created and executed by a single process. I'd still use userboot, I just want to have all of the functionality in one executable. I also want to be able to boot a kernel directly without a bootloader. I think we'll want to support different "flavours" of vCPU initialization in order to support these different usecases.

Ahh, right. ISTR that Rob Norris had a prototype that added Linux kernel booting to bhyve, or something to that effect. I wonder if he has anything salvageable here? I think he was abstracting it away so that it could be made to work with something like this.

Yeah, he had something along these lines. I'm imagining an option -o bootflavour=<linux,freebsd-loader,freebsd-kernel,bootrom> which selects how the BSP is initialized before the guest is launched. "freebsd-loader" would let you run userboot, "freebsd-kernel" would let you boot a kernel directly, "bootrom" would provide the current behaviour, etc..

FWIW, I run head VMs on my stable desktop all the time using bhyveload, but they use UFS. :) I think the caveat in the manpage is fine though (and agree it's not something we support).

usr.sbin/bhyveload/bhyveload.8
182