Setup Boot Camp with hyper-V support

For development I’m using Windows in a Parallels VM on my MacBook Pro. To use docker on Windows I need to enable Hyper-V.

Parallels has an option called “nested virtualisation” where the guest OS can do virtualisation. For this you’ll need a Pro subscription, which I don’t have. This means I cannot use nested virtualisation.


My only option is setting up Boot Camp and boot native into Windows. My hurdles steps are listed below.

Disk space

The first step in the Boot Camp Assistant is setting up the Boot Camp partition. I want to assign 80Gb since I’m installing Windows, Visual Studio, Docker and some other development stuff. My disk reports 105Gb of free space so that’s okay .. not ..

The assistant lets me assign max 48 Gb. What is going on? Seems that local time machine backups secretly eat into your available disk space. Luckily there is a way of removing these hidden files. The assistant now lets me create the partition of 80Gb.

Remove partition

The ISO file I downloaded from the msdn subscriptions page was incompatible and resulted in an error. Looks like only the commercial version of the ISO is supported. Now I have a corrupted Boot Camp partition. To remove these I used Disk Util as described here.


After downloading the supported ISO file and rebooting (have you tried turning it off and on again) the Boot Camp assistant did the job.

Installation

After a reboot I was presented the Windows 10 installation setup. Boot Camp installed the drivers after the first login. Another reboot and Visual Studio, Docker, … all installed without issues. Happy developer 😉

Cold boot

The next day I started my MacBook into Windows and docker crashed…
The logfile presented me with this:

Virtual machine ‘MobyLinuxVM’ could not be started because the hypervisor is not running (Virtual machine ID ~some GUID~).
The following actions may help you resolve the problem:
1) Verify that the processor of the physical computer has a supported version of hardware-assisted virtualization.
2) Verify that hardware-assisted virtualization and hardware-assisted data execution protection are enabled in the BIOS of the physical computer. (If you edit the BIOS to enable either setting, you must turn off the power to the physical computer and then turn it back on. Resetting the physical computer is not sufficient.)
3) If you have made changes to the Boot Configuration Data store, review these changes to ensure that the hypervisor is configured to launch automatically.

Google suggested to run this command to check if Hypervisor was activated/present. The answer was False.

(gcim Win32_ComputerSystem).HypervisorPresent

There seems to be a virtualisation bug that disables hyper-v on a cold boot. For now I’ll be booting into macOS and then booting into Windows. The command above will return True this way and everything works.

Aftermath

The option of running Windows in Parallels still interested me. By installing a trial version of Parallels Desktop I was able to start the Boot Camp Windows installation from within macOS. In the trial version all options are available, so I used the nested virtualisation option. The machine creation took some time while installing the Parallels Tools. But right after the startup (again) docker crashed.

Docker also crashed when native booted into Windows. This was resolved after uninstallation of the Parallels Tools. No Parallels for now.

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development, Tooling and tagged , , , , , . Bookmark the permalink.

2 Responses to Setup Boot Camp with hyper-V support

  1. hi, so can you then install osx in a hyper v vm while windows is running in bootcamp? i.e. so you don’t need to boot into osx at all and still dev Xamarin ios apps etc?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.