nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

intel hax should be installed by default for mac users #141

Closed eyberg closed 4 years ago

eyberg commented 5 years ago

there are pre-made verified builds by intel

one note - it looks like only osx 10.10 and above is supported so there can be a quick version check done to see if we can even install or not but if we can we should

ExternalReality commented 5 years ago

@eyberg can you point me at the pre-made builds so I can give this a go? For some reason I am having trouble finding them.

eyberg commented 5 years ago

just copying some old notes -->

https://github.com/intel/haxm https://software.intel.com/en-us/blogs/2014/10/20/how-to-ensure-you-are-using-intel-haxm-for-android-emulator

If you want to enable HAX (intel hardware acceleration) on Mac you have to options:

You can either roll your own kernel extension or you can download a dmg:

Roll Your Own Extension
boot into recovery mode (reboot && cmd-shift-R) and disable system integrity either of the two following methods:
csrutil enable --without kext
csrutil disable
git clone https://github.com/intel/haxm

build the kernel extension: (note: substitute the 10.13 for whatever is in sw_vers -productVersion)

xcodebuild -config Release -sdk macosx10.13

sudo chown -R root:wheel intelhaxm.kext

sudo kextutil intelhaxm.kext

Download a signed dmg
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x

You should now be able to see that hax is working: qemu-system-x86_64 -accel hax

this task is actually composed of a few sub-tasks imo:

eyberg commented 5 years ago

just as a fyi - we should not be disabling sip for end-users - that's just a debugging mechanism

ExternalReality commented 5 years ago

Some thoughs:

enumerate osx version to determine what .dmg should be loaded

The the latest official .dmg as of writing is 7_4_1. This version supports macos versions as far back as Yosemite. I'm thinking this one .dmg could be good enough.

need perms request in installer

Does this mean curl https://ops.city/get.sh -sSfL | sudo bash

eyberg commented 5 years ago

oh I didn't know that - if that's the case awesome - if someone has something before that they can open a new issue on it -thanks

eyberg commented 4 years ago

closing this as old as we use hvf now