Hyper-V in Windows 10 on MacBook Pro
Solution 1:
Know this is a year old, but instead of using Parallels and suffering with nested virtualization, you can enable VT-x prior to Windows booting up by using the rEFInd boot loader. This is the blog post I wrote about how to do it:
http://nuts4.net/post/hack-force-vt-x-to-be-always-on-when-booting-to-windows-on-your-macbook
WARNING: While this has worked on many Intel-based Mac's, rEFInd messes with the Model Specific Registers on the Intel processor to enable VT-x. If Apple should ever come out with an AMD-based laptop, or Intel makes massive changes to their MSR's in future versions of their chips, make sure rEFInd supports your specific processor! You do these steps at your own risk.
- Go here and download rEFInd (the zip version): http://www.rodsbooks.com/refind/getting.html
- Extract the zip to a folder, open the refind folder and edit refind.conf-sample.
- In refind.conf-sample: Set the timeout to 5 seconds (or whatever you want) Find enable_and_lock_vmx, uncomment the line and set it to true
- Shut down your computer.
- After powering back up, press and hold Command+R before the chime/apple logo appears to boot into Apple Recovery.
- Once in Apple Recovery, go to Utilities -> Terminal.
- Navigate to the folder where you extracted rEFInd, and run ./refind-install
- If a warning about SIP (System Integrity Protection) appears, press "y", and continue with the installation. We're in Recovery Mode, so SIP should be disabled at this point.
- Note: The installer will copy the refind.conf-sample file to EFI/refind/refind.conf on your ESP partition. If you need to change settings later on, you'll have to mount the partition first (use the first two commands from the uninstall instructions below to mount it.)
- Reboot your Mac. (Now, your Mac may freeze. If it does, press and hold the power button until the LCD turns off, then turn it back on.)
You'll be greeted by a GUI bootloader menu, which will load whatever OS you sat as your default. In my case, this was Windows, and Hyper-V worked flawlessly from a cold boot!
If by chance you want to use something other than Hyper-V, you'll need to use bcdedit
in Windows to disable the hypervisor (since Hyper-V takes exclusive control over VT-x once Windows boots):
bcdedit /set {current} hypervisorlaunchtype off
<-- Turns off Hyper-V
bcdedit /set {current} hypervisorlaunchtype on
<-- Turns on Hyper-V
Solution 2:
It is because of the discontinuance of support for CSM (Compatibility Support Module, which basically allows legacy BIOS stuff to work on new UEFI based systems) in the newest MacBook Pro models.
Two main practical workarounds exists:
Instead of using BootCamp, use a virtualization system running on macOS such as VMware Fusion, Parallels, etc. You can use nested virtualization to run the Docker containers using Hyper-V on Windows that way.
Buy an older model of MacBook Pro which still supports booting Windows 10 with Hyper-V enabled.
I would recommend option 1. Both because a newer model gives you more bang for the buck usually, but also because Microsoft might in the future upgrade the Hyper-V functionality to work on the UEFI-only systems without CSM such as the latest MacBook Pro.