Docker inside VirtualBox

dockervirtualbox

Short: Is it possible to run docker container (microsoft/windowsservercore) inside VirtualBox (Windows 10 Enterprise). Host OS is Windows 10 Professional?

Long: I managed to install and start docker inside VirtualBox (Win10Ent), but when I try to create container I get the following error:

docker.exe: Error response from daemon: container b9aef43f6b30853bc1f32fc663fdb5155a62f0dcb4be860c23a8b48fefae4d0a encountered an error during CreateContainer: failure in a Windows system call: No hypervisor is present on this system.

Here is similar question and the conclusion is that VirtualBox does not support nested virtualization, so Docker cannot be run inside of it.

Having that said what is the option of VirtualBox machine under Settings -> System -> Acceleration -> Hardware Virtualization?
Can you explain what this Settings tab really means if VirtualBox does not support nested virtualization?

Best Answer

Virtualbox hardware virtualization option is to allow the virtualization capabilities provided by the processor(https://www.virtualbox.org/manual/ch10.html). This does not help with nested virtualization. You can run in Docker in Virtualbox as long as there is no hypervisor running inside. That is the case when we run Docker on Linux systems in Virtualbox. With Windows server, they run hyperv as well on top of which they run Windows server where Docker runs. Thats why nested virtualization is needed here. For this case, use something like Vmware player that supports nested virtualization. I use VMware player for cases where nested virtualization is needed. The other option is to use native Windows server that has hyperv.