Cohabitation Docker & VirtualBox on Windows

gaucib picture gaucib · Oct 26, 2016 · Viewed 8.4k times · Source

Docker uses the Hyper V functionality so it has to be enabled for Docker to work properly. However, the Hyper V functionality has to be disabled for VirtualBox to work properly (it's possible to create guests and emulate them but only if they're 32bits machines it seems).

Is there any way to have an healthy cohabitation with the two and for them to work at the same time? Instead of enable/disabling the Hyper V option and reboot every time?

Answer

Runcy Oommen picture Runcy Oommen · Oct 26, 2016

I understand your pain-point, but AFAIK this is just not possible to attain because of the simple fact that the virtualization technologies you mentioned here are of different types.

Hyper-V is a "Type 1" hyper-visor which runs on host machine hardware. Other examples in this category include Citrix XenServer and VmWare ESXi. Virtual Box is a "Type 2" hosted hyper-visor which runs within an OS. Other examples in this category include VmWare Player.

If you need to toggle b/w these, a restart is eminent.

A quick way to see the mode is by running "bcdedit" from Command Prompt to see the current config.

  1. To disable Hyper-V run:

bcdedit /set hypervisorlaunchtype off

  1. To turn Hyper-V back on run:

bcdedit /set hypervisorlaunchtype auto

However, you would need to reboot in both the cases. I just mentioned a easy config way to make you understand what was happening in the boot loader when toggling between the Type 1 and Type 2 hyper-visor modes.