machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.44k stars 356 forks source link

Log the error if hv_vm_create fails #202

Closed ntkme closed 3 years ago

ntkme commented 3 years ago

After using @shanesmith's patch I'm getting hv_vm_create failed on Big Sur. This PR would improve the visibility when we have issue with hv_vm_create.

This patch is originally at https://github.com/moby/hyperkit/pull/223. Credit goes to @djs55.

shanesmith commented 3 years ago

I had hacked something similar myself when I ran into the same issue, nice to see it done properly here. =)

BTW I was able to get around hv_vm_create failed by disabling code signing as mentioned in https://github.com/machyve/xhyve/issues/191

I wonder if we'll need a PR to disable code signing in the project config? @jasnee

ntkme commented 3 years ago

@shanesmith Somewhat off-topic, but I'm using the Makefile in the project which does not appear to do code signing. In my case crash report says "Exception Type: EXC_CRASH (SIGABRT)", and the error was HV_ERROR, which is not helpful. :-(

shanesmith commented 3 years ago

I couldn't get the Makefile working for me so I've been using xcodebuild, which is what's recommended for macOS anyhow.

rbishop commented 3 years ago

Getting the same problem as ntkme now. xhyve was working on Big Sur so I'm not sure what changed as I'm using the same arguments and VM images as always. I've built xhyve using the makefile as well as a signed one using xcodebuild. I don't really know what's going on so I'm going to throw out a few random observations:

I was only able to get the xcodebuild product to work if I removed the com.apple.vm.networking entitlement, otherwise it crashed due to entitlements even though I signed it properly. It sounds like that particular entitlement is only allowed to be signed by blessed profile's from Apple and I wonder if Hypervisor.framework's entitlement is headed for a similar fate now?

It's also worth pointing out that QEMU also crashes when using the Hypervisor.framework accelerator.