19

I am getting an error upon installing docker on azure virtual machine.

enter image description here

m/c configuration: azure vm, windows 10 enterprise, Intel 2.4 GHz, 7 GB RAM, 64-bit operating system, x64-based processor. I went through a few blogs and they asked me to enable nested virtualization on azure vm as follows.

Set-VMProcessor -VMName MobyLinuxVM -ExposeVirtualizationExtensions $true

But this also didn't help and the virtual m/c MobyLinuxVM failed to start. I have installed Hyper-V and Container components from windows features. But the error shows "because one of the Hyper-V components is not running" whereas all the components of Hyper-V are running. I checked the task manager performance tab and I don't see the virtualization option there. I can't modify the virtualization settings in the BIOS as I am installing docker on an Azure VM. Also I tried disabling the windows firewall but that didn't help. So how to run docker on azure virtual m/c windows 10 enterprise.

Rajat Agrawal
  • 357
  • 1
  • 2
  • 9
  • You could install docker on Azure Windows 10 enterprise. Please ensure you should enable Hyper-V firstly. Virtualization is available on DV3 and EV3 VM. Please refer to https://azure.microsoft.com/en-us/blog/nested-virtualization-in-azure/ – Shui shengbao Jul 21 '17 at 07:09
  • I test in my lab, it works fine on my Windows 10 VM which sku is `Standard D2 v3`. – Shui shengbao Jul 21 '17 at 07:09

3 Answers3

19

Here is a solution if you are getting this error on Azure Windows 10 VM where you have installed Docker:

  1. Ensure Windows Hyper-V featutes are enabled by running PowerShell cmdlet:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -Verbose

  1. Ensure Windows Containers feature is enabled by running PowerShell cmdlet:

Enable-WindowsOptionalFeature -Online -FeatureName Containers -All -Verbose

  1. Ensure Hypervisor is set to auto start in the Boot Configuration Database (BCD) by running in elevated command prompt the command:

bcdedit /set hypervisorlaunchtype Auto

After running all of the above and you restart the Azure VM, Docker should be starting normally.

Emil
  • 2,196
  • 2
  • 25
  • 24
  • 1
    Docker will try to start by using WSL by default will show up a crash screen on startup. There will be a prompt for switching the back end also. Just close the crash message window and select "Use Hyper-V" when prompted. Docker will be restarted without any issues. – rinesh Jul 04 '21 at 05:15
13

Azure doesnt yet allow for nested virtualization.
You need to use DSv3 or E3 instances for that. Just use docker like you normally would

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • 1
    tested with a Standard D2s v3 (2 vcpus, 8 GB memory), created the VM, installed docker for windows, when prompted to activate hyper-V, selected yes and rebooted. everything was fine – Cedric Dumont Aug 29 '17 at 12:53
  • 1
    well, dsv3 were not available at the time of writing so... @CedricDumont – 4c74356b41 Aug 29 '17 at 13:40
  • 1
    I had this same problem with D2s_v3. I did not expect it to work, but when I changed it to D4s_v3 Docker started successfully. – Micah B. Jan 09 '20 at 23:13
  • Switching from D2s_v3 -> D4s_v3 worked for me as well. Thanks! – Miles May 14 '20 at 15:29
3

Microsoft offers images with preinstalled docker enterprise. This works even on a B2s VM. Just select any of the "Microsoft Server 2019/2016 Datacenter with containers" image while creating the VM.

pgampe
  • 4,531
  • 1
  • 20
  • 31