At first the docker work well on my Windows 10 with official version.
Then I deleted the MobyLinuxVM in Hyper-V for some reason. After that the docker can\'t work. <
I also faced a similar issue, In my case, i tried to remove MobyLinux VM unaware of all the dependencies, thus the virtual machine was unable to create DockerNAT virtual switch in Hyper-V as Docker starts. Docker tried to create a running virtual machine (open Hyper-V when launching docker to monitor) but the vm failed and stopped.
I fixed it by:
Uninstalling Docker
I changed the default hyper-v virtual machines folder HyperVsettings createdFolder
Reinstalling Docker.
Docker creates a new MobyLinux file inside the new folder and everithing is Ok now.
Then I reinstall the docker and turn on the feature of Hyper-V again.
Make sure to turn on the feature of Hyper-V first (and reboot)
Then reinstall Docker for Windows.
See "What to know before you install":
The current version of Docker for Windows runs on 64bit Windows 10 Pro, Enterprise and Education (1511 November update, Build 10586 or later).
The Hyper-V package must be enabled for Docker for Windows to work. The Docker for Windows installer will enable it for you, if needed.
Your particular error message is reported in docker/for-win issue 248 and before that in issue 214
Unable to create:
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:
The object already exists.
As noted in this comment and here, try and delete the saved VM and restart.
you should be in
C:\Program Files\Docker\Docker\resources
to run the commands.
So let me refine the sequence of commands that you could run:
com.docker.service
cd 'C:\Program Files\Docker\Docker\resources'
.\MobyLinux.ps1 -Destroy
C:\Users\Public\Public Documents\Hyper-V\Virtual hard disks\MobyLinuxVM.vhdx
) is removed.\MobyLinux.ps1 -Create
Problem solved!!
I tried the method which VonC provided, though still can't work, but I found one thing that while I run the command .\MobyLinux.ps1 -Create
, it prompts that the VNAT creation error. Then I open the network adapter list, found that there are many "disconnected adapter" which is created by Hyper-V(During these time, I've turn off and turn on several times, each time it won't recognize the older adapters which docker can). So the adapter which docker found doesn't match which the Hyper-V found, and will prompt "object already exists" and won't create new one.
At last, what we need to do is to open the device manager and delete the unnecessary adapters -- then the docker successfully started!
Finally, great thank for the first answer by VonC
It doesn't support spaces on your path of hyperV unit.
You need to configure on your hyperV configuration a path without spaces.