Evil Twins – VirtualBox & Hyper-V coexisting

Over the last year I’ve been utilising Docker more and more. Today I needed to fire up an old virtual machine that I use a couple of times a year. The VM is in VirtualBox. It wouldn’t start. The error was;

Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT)

Docker Desktop for Windows uses Microsoft Hyper-V for virtualization, and Hyper-V is not compatible with Oracle VirtualBox. Therefore, you cannot run the two solutions simultaneously.

Now I wasn’t going to go to the trouble of migrating my VM from Virtual Box to Hyper-V for the 1 to 2 times a year I need to use it. And I wasn’t going to migrate it to Azure for the little use it gets either.

After some Googling I found the answer. Temporarily disable Hyper-V. In an elevated PowerShell session run;

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor

After a restart Virtual Box will start the VM. When finished with VirtualBox run;

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor

After a restart Docker and Hyper-V are back in action.

Posting this will let me find it quickly next time. Maybe it’ll help someone else too.

 

Azure VM Docker CreateContainer Error (0xc0370102)

A real quick post as I’ve just managed to figure out what was causing this error and why my Docker CreateContainer call wasn’t successfully executing.

I’d just deployed a brand new Windows 10 VM in Azure Resource Manager and installed Docker. But when I attempted to create a new container I was getting the error below in both the Docker console and in the Application Event Log.

---snippet start---
Handler for POST /v1.38/containers/6f6e2c37142a63db7a19e2533a97b8affad52b735d7cfcbbd2b69ce87ef4c36c/start
returned error: container 6f6e2c37142a63db7a19e2533a97b8affad52b735d7cfcbbd2b69ce87ef4c36c 
encountered an error during CreateContainer: failure in a Windows system 
call: The virtual machine could not be started because a required feature 
is not installed. (0xc0370102) extra info:
 {"SystemType":"Container","Name":"6f6e2c37142a63db7a19e2533a97b8affad52b735
d7cfcbbd2b69ce87ef4c36c","Owner":"docker","IgnoreFlushesDuringBoot":true,
"LayerFolderPath":"C:\\ProgramData\\Docker\\windowsfilter\\6f6e2c37142a63db7
a19e2533a97b8affad52b735d7cfcbbd2b69ce87ef4c36c","Layers":[{"ID":"4457d5ac-
9bda-5212-b74c-
---snippet end---

The key words out of all that are:

CreateContainer: failure in a Windows system call: The virtual machine could not be started because a required feature is not installed. (0xc0370102)

…. but search as you might, you can’t find anything anywhere. Through my troubleshooting process I tried creating a Hyper-V VM which I could, but it wouldn’t start with an error the a Hyper-V Process was not installed/running.

Thinking through want I was trying to do and the errors from both Hyper-V and Docker I realized it need to be something to do with Nested Virtualization.

Light-bulb Moment

Support for Nested Virtualization in Azure VM’s is dependent on the generation of the underlying host. When Microsoft started supporting the Intel Broadwell processors, they also enabled Nested Virtualization on some VM Sizes.

Changing my VM Size from a DS_v2 to a DS_v3 was all that I had to do. My Docker Containers are now running on a Windows 10 Virtual Machine in Azure Resource Manager.

FYI, Azure Dv3 and Ev3 VM’s support Nested Virtualization and I’m sure there are also now others. Hopefully I’ve saved someone else the two hours I’ve just lost.