machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.43k stars 353 forks source link

Still doesn't work on Big Sur for me #207

Open marclp-es opened 3 years ago

marclp-es commented 3 years ago

I installed it using "brew install --HEAD xhyve" and I am still getting this error. vmx_set_ctlreg: cap_field: 2 bit: 20 unspecified don't care vmx_init: processor does not support desired secondary processor-based controls Unable to create VM (22)

I am not sure if it is just my system or if it's happening for everyone, cause I saw some ppl managed to make it work.

marclp-es commented 3 years ago

Okay, I fixed it, I used this branch, It includes all of the fixes and then I resigned the code following this guide

durdin85 commented 3 years ago

Okay, I fixed it, I used this branch, It includes all of the fixes and then I resigned the code following this guide

I've recently upgraded from Catalina to Big Sur and faced similar problem, but only when I've run the binary from Catalina the error was same as from marclp02. When I've rebuilt in directly on BigSur it just crashes with: hv_vm_create failed xhyve-test.sh: line 5: 1262 Abort trap: 6

However, I've also tested the shanesmiths bigsur-allf-fixes branch with combination of resining binary and could confirm it works on Big Sur so It would be nice to marge these fixes into this official repo..

bjer commented 3 years ago

No luck with home brew but if checking out the master branch, build and then running codesign as outlined here xhyve works on Big Sur amd64.

ktgvv commented 3 years ago

This is broken on so many levels...

First, the installation via MacPorts fails. I don't know whether or not this is due to Xhyve, but other users reported it failing via Homebrew either.

sudo port install xhyve output:

Warning: The macOS 11.2 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Fetching archive for xhyve
--->  Attempting to fetch xhyve-20191002_0.darwin_20.x86_64.tbz2 from https://packages.macports.org/xhyve
--->  Attempting to fetch xhyve-20191002_0.darwin_20.x86_64.tbz2 from https://mse.uk.packages.macports.org/xhyve
--->  Attempting to fetch xhyve-20191002_0.darwin_20.x86_64.tbz2 from https://fra.de.packages.macports.org/xhyve
--->  Building xhyve
Error: Failed to build xhyve: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_xhyve/xhyve/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port xhyve failed

Second, Xcodebuild succeeds in building Xhyve, whereas GNU Make fails. Right from the start, booting FreeBSD is a no go.

make output:

cc src/vmm/x86.c
error: include location '/usr/local/include' is unsafe for cross-compilation [-Werror,-Wpoison-system-directories]
1 error generated.
make: *** [build/vmm/x86.o] Error 1

Also, both xhyverun-freebsd.sh and xhyverun-windows.sh, so prolly xhyverun-tinycorelinux.sh, fail too.

sudo ./xhyverun-freebsd.sh output:

./xhyverun-freebsd.sh: line 18: 89413 Killed: 9               xhyve -A -m 2G -c 2 -s 0:0,hostbridge -s 2:0,virtio-net -s 3:0,ahci-cd,$BOOTVOLUME -s 4:0,virtio-blk,$IMG -s 31,lpc -l com1,stdio -f fbsd,test/userboot.so,$BOOTVOLUME,""

sudo ./xhyverun-windows.sh output:

./xhyverun-windows.sh: line 9: 89418 Killed: 9               xhyve -w -m 4G -c 2 -s 0:0,hostbridge -s 3,ahci-cd,$BOOTVOLUME -s 4,ahci-hd,$IMG -s 5,e1000 -s 29,fbuf,tcp=127.0.0.1:29000,w=1024,h=768,wait -s 31,lpc -l com1,stdio -l bootrom,$FIRMWARE

And that's too bad, really. I'll have to fork over $149.99 for a VMware Fusion 12 license. 😛

wmertens commented 3 years ago

FYI, seems to work with nixpkgs, you can either run it ephemerally with nix-shell -p xhyve or install it to your profile wiith nix-env -iA nixpkgs.xhyve

tschuxxi commented 3 years ago

As mentioned by others, it would be great if the fix could be merged so the Homebrew installation is working again

TiagoJSilva commented 3 years ago

I'm also having the _hv_vmcreate failed (Abort trap:6) error on Big Sur (11.2.3) when installed from Homebrew. Is it still broken on Homebrew, or did I miss a step somewhere?

adarobin commented 2 years ago

It looks like on Big Sur you have to have an entitlement to use the Hypervisor framework. I knew it works with QEMU so I poked around and found this commit.

If you create a file (entitlements.plist) that contains

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.hypervisor</key>
    <true/>
</dict>
</plist>

and then run something like codesign --entitlements entitlements.plist --force -s - /usr/local/bin/xhyve xhyve will sort of work on Big Sur.

Networking appears to be broken. If you attempt to use it, you will probably see this error

virtio_net: Could not create vmnet interface, permission denied or no entitlement?

I tried adding the com.apple.vm.networking entitlement but it appears that is not allowed without Apple's approval.