Rajat Agrawal
Rajat Agrawal

Reputation: 367

Installing docker on azure virtual machine windows 10

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.

Upvotes: 20

Views: 27097

Answers (6)

Tore Nestenius
Tore Nestenius

Reputation: 19901

I had the same problem, and my solution was to do the following:

  1. Ensure that the VM SKU size supports virtualization, and I usually use Standard_D2s_v3 or Standard_D2s_v4.

  2. Ensure you do not enable Trusted Launch Virtual Machines because this feature disables virtualization inside the VM.

I blogged about the details about how to get Docker to run in Azure here: Running Docker in an Azure Windows Virtual Machine – Not so fast!

Upvotes: 0

Nishant Parmar
Nishant Parmar

Reputation: 11

I had the same problem while installing Docker Hub on Azure Win 10 VM, but i find vary easy fix to this.

  1. Make sure the VM you are choosing is supported by nested virtualization. Here I used D4s_v4 (4vCPU and 16GB Ram). Description Of D4s_v4 VM

2.While Creating the VM make sure you have change the security type to "Standard" from "Trusted Lunch Virtual machines" Security Type Image

  1. Also make sure that you've enabled the Hyper-v , Windows Subsystem For Linux and etc. etc. you found till now on google....

Upvotes: 1

Indrajeet Singh
Indrajeet Singh

Reputation: 532

As mentioned above use DSv3 or E3 instances. in case it doesn't work for you, check for security type while creating Azure Virtual Machine, Now a days it 'Trusted Launch Virtual Machine", switch it back to Standard and install docker as usual. It should be working.

Upvotes: 0

pgampe
pgampe

Reputation: 4578

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.

Upvotes: 3

Emil
Emil

Reputation: 2346

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.

Upvotes: 19

4c74356b41
4c74356b41

Reputation: 72151

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

Upvotes: 13

Related Questions