1

I just installed Docker on Windows 10. When I run Docker as an administrator I get the following error:

Unable to create: The running command stopped because the preference 
variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V 
encountered an error trying to access an object on computer 'WP2975' because 
the object was not found. The object might have been deleted. Verify that 
the Virtual Machine Management service on the computer is running.
at New-Switch, <No file>: line 121
at <ScriptBlock>, <No file>: line 411
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) 
in C:\workspaces\stable 18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean 
showWelcomeWindow, Boolean executeAfterStartCleanup) in 
C:\workspaces\stable- 
18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
at Docker.Actions.<>c__DisplayClass19_0.<Start>b__0() in 
C:\workspaces\stable- 
18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in 
C:\workspaces\stable- 
18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

I checked if Hyper-V is running on the computer.

I also did the following in powershell:

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

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

Ensure Windows Containers feature is enabled by running PowerShell cmdlet:

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

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

( Found it on: Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is not running )

But nothing helps.

I also reinstalled docker two times.

Ayoub Rossi
  • 410
  • 5
  • 18
  • Have you tried running `MOFCOM %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof` in Command Prompt as administrator. Restart your machine afterwards. Found here: https://community.spiceworks.com/how_to/122307-fix-error-managing-hyper-v-server-2012-r2-from-windows-10 – user3613919 Feb 08 '19 at 18:50
  • MOFCOM is not recognized, I tried – Ayoub Rossi Feb 08 '19 at 18:53
  • Sorry, It was a typo (MOFCOMP not mofcom): `MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof` – user3613919 Feb 08 '19 at 19:02
  • I noticed just after I answered and tried it but it didn't help even after the reboot. – Ayoub Rossi Feb 08 '19 at 19:04
  • What is the Build number of Windows that you are using , it is like the most updated one ? – Soumen Mukherjee Feb 08 '19 at 19:22

2 Answers2

2

Please do make sure that the following three windows services are in running state

HV Host Service
Hyper-V Host Compute Service
Hyper-V Virtual Machine Management
Soumen Mukherjee
  • 2,953
  • 3
  • 22
  • 34
  • Hyper-V Host Compute Service is not running. I can't run it ( ERROR 1053 ). – Ayoub Rossi Feb 08 '19 at 19:36
  • Can you try out the following Step-By-Step: Enabling Hyper-V for use on Windows 10 https://blogs.technet.microsoft.com/canitpro/2015/09/08/step-by-step-enabling-hyper-v-for-use-on-windows-10/ 2. Most Hyper-v issues are relate to the network, please try to update the network driver to the latest version and see if it helps. 3. Please also refer to the following article and see if it helps. A Workaround for Finding Missing Hyper-V Tools in Windows 10 https://www.petri.com/workaround-finding-missing-hyper-v-tools-windows-10 – Soumen Mukherjee Feb 08 '19 at 19:39
  • It works good with Windows containers but when I switch to linux containers it doesn't. – Ayoub Rossi Feb 08 '19 at 19:47
  • Under the docker desktop settings --> Advanced do you see the path of MobyLinux's Virtual Hard Disk , it could be like C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx , does it exists. – Soumen Mukherjee Feb 08 '19 at 19:53
  • No there is nothing next to disk image location – Ayoub Rossi Feb 08 '19 at 19:56
  • When I manually go to that path it is empty, there is nothing under Virtual Hard Disks – Ayoub Rossi Feb 08 '19 at 19:59
  • You may need to reinstall Docker Desktop , in which case it will re-download the Virtual machine file – Soumen Mukherjee Feb 08 '19 at 20:10
  • I did that twice... All of this is on the computer that they gave me at work. Is it possible that I doesn't work because I am trying it at home? – Ayoub Rossi Feb 08 '19 at 20:13
  • Make sure that when you run the installer you run it as admin and there is no disk space issue as well , since the file is more than 5 GB... – Soumen Mukherjee Feb 08 '19 at 20:19
  • OK so try this first C:\>"Program Files\Docker\Docker\resources\MobyLinux.ps1" -Create True , once done make sure that MobyLinuxVM file should exists in the shared location – Soumen Mukherjee Feb 08 '19 at 20:43
0

If Windows 10 you're referring to has an ancient edition (lower then anniversary, i.e. 1607) there is no chance in hell you can get it working. To check version of your OS run 'winver'. The problem with these editions is that they don't support nested virtualization Docker require.

Now, it's not clear WHERE are you running your VM. If it's VMWare on your PC it should be relatively easy to fix, but if it's Cloud, can be a different story. The thing is that in Azure, for instance, not all VMs support nested virtualization, so if you hastened to provision a VM, it might be a problem. If you want to get it right, use v3 VM types and up (refer this article for more info).

In my case 'HV Host Service' didn't work as well, but fortunately I was able to resize a VM to a proper tier (v3) and voila! Docker started right away.

John Bull
  • 933
  • 1
  • 12
  • 20