Hypervisor framework problems in Big Sur

I have 3 problems in this post.

1. hv_vm_create() fails
I recently got the BigSur beta (I'm on the latest) to try out some hypervisor app I've been working on, however hv_vm_create() fails.

2. Killed: 9 when signing with Hypervisor entitlements
I figured Big Sur might be enforcing entitlements, so I signed it with the same entitlements from xyhve (and updated it as per the documentation) but this time I was getting.
Code Block
Killed: 9

Do I have to request permission to use those entitlements? That's the conclusion I'm coming to because HypervisorKit just doesn't work; and nothing happens on macOS for no reason.

3. HypervisorKit in beta?
This is what confuses me the most. Why are HypervisorKit functions that have existed since 10.10 in beta? And why does the documentation claim they're available only on macOS 11.0+? I think you guys should double check the docs.

Accepted Reply

And can the admin edit the title to Hypervisor Framework?

Hey hey, it turns out I can do that!

I get error -85377023 with hv_vm_create

Hmmm, -85377023 translates to 0xfae94001 which translates to HV_ERROR. Not very helpful.

I tried this here in my office (on 11.0b9, haven’t done the update yet) and see the same result. Looking in the system log I see this:

Code Block
type: default
time: 2020-10-06 05:16:14.139878 -0700
process: kernel
message: AppleHV: /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Hypervisor_kext/Hypervisor-113.40.13/x86_64/kext/x86/vmx/hv_vmx_vm.cpp : static hv_vmx_vm_t *hv_vmx_vm_t::create(hv_vmx_vm_t *, user_addr_t) : 1686


This indicates that a specific routine within the KEXT that backs the Hypervisor framework failed. Unfortunately that 1686 is not an error code but a line number, and it’s hard for me to track that down (I’m pretty sure I know what line it is but that failure has many potential causes).

Unfortunately this is about as far as I can take this. Normally I’d suggest you open a DTS tech support incident but DTS doesn’t support pre-release software, and that includes the current 11.0 beta.

Beyond that my only recommendation is that you file a bug about this. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

Replies

I figured Big Sur might be enforcing entitlements

Requiring entitlements is not new to 11.0 beta.

Do I have to request permission to use those entitlements?

Yes.

Why are HypervisorKit functions that have existed since 10.10 in beta?

There is no HypervisorKit, just Hypervisor framework.

This framework has been extensively enhanced in 11.0 beta, so you’ll hit many routines annotated with that availability. However, the framework was present and functional on older systems and the older functions are annotated as such.

Contrast:
Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

There is no HypervisorKit, just Hypervisor framework.

Yeah my bad with "Kit". I confuse the naming scheme with AppKit/HomeKit/WatchKit. Will the documentation be completed, because it looks like there are a bunch of MSR and register functions missing.

And despite requiring permission for the entitlements, is that the reason hvvmcreate failed? Because I didn't add entitlements the first time? Because this project isn't sandboxed and has hardened runtime disabled.

Will the documentation be completed

I can’t predict the future, alas.

because it looks like there are a bunch of MSR and register functions
missing.

Indeed. The best way to get that feedback to the relevant folks is to file a bug against the docs. Please post your bug number, just for the record.

And despite requiring permission for the entitlements, is that the
reason hv_vm_create failed?

The tricky thing about hv_vm_create is that there are two flavours. If you’re building for Intel you’re get the one from <Hypervisor/hv.h> that has this signature:

Code Block
extern hv_return_t hv_vm_create(hv_vm_options_t flags) __HV_10_10;


Note that this is 10.10 and later.

If you’re building for Arm you get the one from <Hypervisor/hv_vm.h> that has this signature:

Code Block
API_AVAILABLE(macos(11.0)) API_UNAVAILABLE(ios)
OS_EXPORT
hv_return_t
hv_vm_create(hv_vm_config_t _Nullable config);


Note that this requires 11.0 beta.

Which one are you calling? And what error result do you get back?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
My apologies for replying a week later, I've been busy.

Which one are you calling? And what error result do you get back?


I get error -85377023 with hv_vm_create, and I can confirm I'm using the right header (hv.h not hv_vm.h), which is supposed to be the x86 flavor. And can the admin edit the title to Hypervisor Framework?

And can the admin edit the title to Hypervisor Framework?

Hey hey, it turns out I can do that!

I get error -85377023 with hv_vm_create

Hmmm, -85377023 translates to 0xfae94001 which translates to HV_ERROR. Not very helpful.

I tried this here in my office (on 11.0b9, haven’t done the update yet) and see the same result. Looking in the system log I see this:

Code Block
type: default
time: 2020-10-06 05:16:14.139878 -0700
process: kernel
message: AppleHV: /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/Hypervisor_kext/Hypervisor-113.40.13/x86_64/kext/x86/vmx/hv_vmx_vm.cpp : static hv_vmx_vm_t *hv_vmx_vm_t::create(hv_vmx_vm_t *, user_addr_t) : 1686


This indicates that a specific routine within the KEXT that backs the Hypervisor framework failed. Unfortunately that 1686 is not an error code but a line number, and it’s hard for me to track that down (I’m pretty sure I know what line it is but that failure has many potential causes).

Unfortunately this is about as far as I can take this. Normally I’d suggest you open a DTS tech support incident but DTS doesn’t support pre-release software, and that includes the current 11.0 beta.

Beyond that my only recommendation is that you file a bug about this. Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the tremendous support. Since it's a learning project and nothing serious I'll just wait for Apple to iron out Big Sur and its Frameworks.
Hello,

I encountered the same problem as you when building on the new Big Sur.
My device: Mac16, base model with latest OS update.
I am building a mini version of xhyve.
My workaround was that I compiled with the following flag(assuming you use clang):  -mmacosx-version-min=10.10
You can also select this target if you build on xcode.
Now it is running for me.
The following article might have an answer to your question No.1.
  • Apple Hypervisor is completely broken on MacOS Big Sur beta 11.0.1 (2020-11-02)

https://stackoverflow.com/questions/64642062/apple-hypervisor-is-completely-broken-on-macos-big-sur-beta-11-0-1