4

I am considering a Mac as my main development machine, and will most of the time be required to use Windows for my development work.

According to the Apple support article Turn off Hyper-V to use Windows 10 on your Mac it is not possible to use Hyper-V in Windows 10 on a Mac in Boot Camp.

This is a big limitation for me, since also it means it will be impossible to use Docker Windows Containers on a Mac, since they require Hyper-V.

Are there any practical workarounds for this?

3

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:

  1. 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.

  2. 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.

  • Is the easiest way to get Docker in Windows 10 Pro working with Parallels, Docker Toolbox and enabling Hyper-V? How to enable the Hyper-V? Related question here. – hhh Jun 26 '17 at 11:18
2

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.

  1. Go here and download rEFInd (the zip version): http://www.rodsbooks.com/refind/getting.html
  2. Extract the zip to a folder, open the refind folder and edit refind.conf-sample.
  3. 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
  4. Shut down your computer.
  5. After powering back up, press and hold Command+R before the chime/apple logo appears to boot into Apple Recovery.
  6. Once in Apple Recovery, go to Utilities -> Terminal.
  7. Navigate to the folder where you extracted rEFInd, and run ./refind-install
  8. 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.
  9. 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.)
  10. 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

0

Navigate to the folder where you extracted rEFInd is not so easy on MacOS recovery mode. It is much better to install rEFInd in a usb drive which will be automatically mounted under Volumes folder. The correct way to activate HYPER-V under an administrative command prompt is by using AUTO e not ON.

bcdedit /set {current} hypervisorlaunchtype auto <-- Turns on Hyper-V

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .