Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" #1538

Closed
sbalbach opened this Issue Jan 12, 2018 · 18 comments

Comments

Projects
None yet
@sbalbach
Copy link

sbalbach commented Jan 12, 2018

Expected behavior

Docker creates VM and runs

Actual behavior

Docker returns an error message

Information

Diagnostic ID 36C19E50-92B6-4017-9891-78A6DEB5C5BC/2018-01-12_07-47-09

Version: 17.12.0-ce-win47 (15139)
Channel: stable
Sha1: 9c692cd5b38166289573183371647d915f300292
Started on: 2018/01/12 07:23:48.775
Resources: C:\Program Files\Docker\Docker\Resources
OS: Windows 10 Enterprise
Edition: Enterprise
Id: 1607
Build: 14393
BuildLabName: 14393.1944.amd64fre.rs1_release.171129-2100
File: C:\Users\PWI_BQD4\AppData\Local\Docker\log.txt
CommandLine: "C:\Program Files\Docker\Docker\Docker for Windows.exe"
You can send feedback, including this log file, at https://github.com/docker/for-win/issues
[07:23:48.931][GUI ][Info ] Starting...
[07:23:49.728][Tracking ][Info ] Crash report and usage statistics are enabled
[07:23:49.728][SegmentApi ][Info ] Usage statistic: appLaunched
[07:23:59.793][SegmentApi ][Error ] Failed to track event appLaunched: timeout after 10s
[07:25:29.829][GUI ][Error ] Error while trying to run NPS survey process.Unable to create an instance of Docker.WPF.Nps.NPS: Unable to create an instance of Docker.WPF.Nps.WootricService
[07:25:29.832][SegmentApi ][Info ] Usage statistic: heartbeat
[07:25:29.845][SegmentApi ][Info ] Usage statistic: Identify
[07:25:30.013][Notifications ][Info ] Docker is starting...
[07:25:30.064][NamedPipeClient][Info ] Sending Version()...
[07:25:30.091][NamedPipeClient][Info ] Received response for Version
[07:25:30.093][NamedPipeClient][Info ] Sending Start(Docker.Core.Settings, Docker.Core.DaemonOptions)...
[07:22:48.333][BackendServer ][Info ] Started
[07:25:30.090][NamedPipeServer][Info ] Version()
[07:25:30.090][NamedPipeServer][Info ] Version done in 00:00:00.
[07:25:30.097][NamedPipeServer][Info ] Start(Docker.Core.Settings, Docker.Core.DaemonOptions)
[07:25:30.104][PowerMode ][Info ] Stop
[07:25:30.113][HyperV ][Info ] Stop
[07:25:30.153][PowerShell ][Info ] Run script with parameters: -Stop True...
[07:25:30.158][PowerShell ][Info ] Creating a Runspace Pool...
[07:25:30.496][PowerShell ][Info ] Runspace Pool created (Min=1, Max=2)
[07:25:30.628][HyperV ][Info ] Script started at 07:25:30.619
[07:25:39.848][SegmentApi ][Error ] Failed to track event heartbeat: timeout after 10s
[07:25:39.880][SegmentApi ][Error ] Failed to Identify: timeout after 10s
[07:25:54.391][HyperV ][Info ] Module loaded at 07:25:54.391
[07:25:54.624][HyperV ][Info ] VM MobyLinuxVM does not exist
[07:25:54.625][HyperV ][Debug ] [stop] took 00:00:24.5097564 to run
[07:25:54.626][OptimizeDisk ][Info ] Optimize
[07:25:54.627][PowerShell ][Info ] Run script...
[07:25:54.648][Moby ][Info ] Stop
[07:25:54.660][HyperVGuids ][Info ] Installing GUIDs...
[07:25:54.660][PowerMode ][Info ] Start
[07:25:54.661][HyperV ][Info ] Create
[07:25:54.662][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\docker-for-win.iso...
[07:25:54.667][HyperVGuids ][Info ] GUIDs installed
[07:25:54.668][Firewall ][Info ] Removing all existing rules...
[07:25:54.676][HyperV ][Info ] Script started at 07:25:54.676
[07:25:54.729][HyperV ][Info ] Module loaded at 07:25:54.729
[07:25:54.744][Firewall ][Info ] All existing rules are removed.
[07:25:54.745][Firewall ][Info ] Opening ports for C:\Program Files\Docker\Docker\Resources\com.docker.proxy.exe...
[07:25:54.762][Firewall ][Info ] Opening ports for SMB...
[07:25:54.960][Firewall ][Info ] Ports are opened
[07:25:55.125][HyperV ][Info ] Creating Switch: DockerNAT...
[07:25:59.177][HyperV ][Info ] Switch created.
[07:26:02.349][HyperV ][Info ] Set IP address on switch
[07:26:03.787][HyperV ][Info ] Creating VM MobyLinuxVM...
[07:26:04.648][Linux ][Error ] Failed to start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Creating the virtual machine failed.
at New-MobyLinuxVM, : line 202
at , : line 409. Let's retry
[07:26:04.964][Installer ][Info ] Checking for features: Hyper-V, Containers
[07:26:04.965][PowerShell ][Info ] Run script...
[07:26:10.251][PowerShell ][Info ] Run script...
[07:26:12.926][PowerShell ][Info ] Run script...
[07:26:15.481][PowerShell ][Info ] Run script...
[07:26:18.047][Installer ][Info ] Features installed
[07:26:18.070][HyperV ][Info ] Hyper-V is running
[07:26:18.070][PowerMode ][Info ] Stop
[07:26:18.070][HyperV ][Info ] Stop
[07:26:18.073][PowerShell ][Info ] Run script with parameters: -Stop True...
[07:26:18.084][HyperV ][Info ] Script started at 07:26:18.084
[07:26:18.101][HyperV ][Info ] Module loaded at 07:26:18.101
[07:26:18.115][HyperV ][Info ] VM MobyLinuxVM does not exist
[07:26:18.115][HyperV ][Debug ] [stop] took 00:00:00.0449953 to run
[07:26:18.115][OptimizeDisk ][Info ] Optimize
[07:26:18.115][PowerShell ][Info ] Run script...
[07:26:18.130][Moby ][Info ] Stop
[07:26:18.142][HyperV ][Info ] Destroy
[07:26:18.143][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True...
[07:26:18.152][HyperV ][Info ] Script started at 07:26:18.151
[07:26:18.169][HyperV ][Info ] Module loaded at 07:26:18.169
[07:26:18.182][HyperV ][Info ] VM MobyLinuxVM does not exist
[07:26:18.184][HyperV ][Info ] Destroying Switch DockerNAT...
[07:26:21.823][HyperV ][Info ] Removing VM MobyLinuxVM...
[07:26:21.892][HyperV ][Debug ] [destroy] took 00:00:03.7499790 to run
[07:26:21.893][Firewall ][Info ] Closing ports...
[07:26:21.893][Firewall ][Info ] Removing all existing rules...
[07:26:22.065][Firewall ][Info ] All existing rules are removed.
[07:26:22.065][Firewall ][Info ] Ports are closed
[07:26:22.067][HyperVGuids ][Info ] Removing GUIDs...
[07:26:22.070][HyperVGuids ][Info ] GUIDs removed
[07:26:22.071][HyperV ][Info ] Create
[07:26:22.071][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\docker-for-win.iso...
[07:26:22.080][HyperV ][Info ] Script started at 07:26:22.080
[07:26:22.101][HyperV ][Info ] Module loaded at 07:26:22.101
[07:26:22.360][HyperV ][Info ] Creating Switch: DockerNAT...
[07:26:25.535][HyperV ][Info ] Switch created.
[07:26:27.661][HyperV ][Info ] Set IP address on switch
[07:26:27.678][HyperV ][Info ] Creating VM MobyLinuxVM...
[07:26:27.816][PowerMode ][Info ] Stop
[07:26:27.816][HyperV ][Info ] Stop
[07:26:27.819][PowerShell ][Info ] Run script with parameters: -Stop True...
[07:26:27.828][HyperV ][Info ] Script started at 07:26:27.828
[07:26:27.857][HyperV ][Info ] Module loaded at 07:26:27.857
[07:26:27.882][HyperV ][Info ] VM MobyLinuxVM does not exist
[07:26:27.882][HyperV ][Debug ] [stop] took 00:00:00.0659961 to run
[07:26:27.883][OptimizeDisk ][Info ] Optimize
[07:26:27.883][PowerShell ][Info ] Run script...
[07:26:27.917][Moby ][Info ] Stop
[07:26:27.925][HyperV ][Info ] Destroy
[07:26:27.926][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True...
[07:26:27.936][HyperV ][Info ] Script started at 07:26:27.936
[07:26:27.974][HyperV ][Info ] Module loaded at 07:26:27.973
[07:26:27.993][HyperV ][Info ] VM MobyLinuxVM does not exist
[07:26:27.995][HyperV ][Info ] Destroying Switch DockerNAT...
[07:26:31.096][HyperV ][Info ] Removing VM MobyLinuxVM...
[07:26:31.112][HyperV ][Debug ] [destroy] took 00:00:03.1869754 to run
[07:26:31.112][Firewall ][Info ] Closing ports...
[07:26:31.112][Firewall ][Info ] Removing all existing rules...
[07:26:31.144][Firewall ][Info ] All existing rules are removed.
[07:26:31.144][Firewall ][Info ] Ports are closed
[07:26:31.144][HyperVGuids ][Info ] Removing GUIDs...
[07:26:31.144][HyperVGuids ][Info ] GUIDs removed
[07:26:31.153][NamedPipeServer][Error ] Unable to execute Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Creating the virtual machine failed.
at New-MobyLinuxVM, : line 202
at , : line 409 at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV.cs:line 181
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 130
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 47
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145
[07:26:31.255][NamedPipeClient][Error ] Unable to send Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Creating the virtual machine failed.
at New-MobyLinuxVM, : line 202
at , : line 409
[07:26:31.258][Notifications ][Error ] Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Creating the virtual machine failed.
at New-MobyLinuxVM, : line 202
at , : line 409
[07:27:20.256][ErrorReportWindow][Info ] Open logs

Steps to reproduce the behavior

Run Docker for Windows on Windows 10 version 1607 (OS Build 14393.1944) while logged in as a non-admin. Right-click Docker icon and select run as administrator. Insert smart card into PC for credentials, select admin account, and enter admin pin.

@jasonbivins

This comment has been minimized.

Copy link

jasonbivins commented Jan 12, 2018

Hi @sbalbach
You mentioned that you have to run as admin to reproduce - does it work for you under your normal user login?

@sbalbach

This comment has been minimized.

Copy link
Author

sbalbach commented Jan 12, 2018

Hi jasonbivins,

I was told that it needed to be run as admin but I just tried a couple more scenarios. I tried running it as a non-admin and got the same error. Then I tried logging in to Windows as an admin and running it and still got the same error. If you like, I can send those logs in too.

Thanks,
Steve

@jtdetwiler

This comment has been minimized.

Copy link

jtdetwiler commented Jan 12, 2018

@PankajLala

This comment has been minimized.

Copy link

PankajLala commented Jan 14, 2018

I am getting same error on Win 10 Azure VM, with Docker for Window.exe
Attached log for reference.

errorlog.txt

@Maikel-Nait

This comment has been minimized.

Copy link

Maikel-Nait commented Jan 15, 2018

This fixed the issue for me
Fix error managing Hyper-V Server 2012 R2 from Windows 10

@sbalbach

This comment has been minimized.

Copy link
Author

sbalbach commented Jan 15, 2018

@Maikel-Nait I just tried your suggestion (which ran successfully) but I still get the same Docker error after.

@Maikel-Nait

This comment has been minimized.

Copy link

Maikel-Nait commented Jan 16, 2018

in my case, both in a laptop and a desktop with a fresh new Windows 10 Pro installation, just running the above command solved my Docker crash on startup. Too bad is not working for everyone. It seems Docker support for Windows 10 still needs a lot of improvement

@jtdetwiler

This comment has been minimized.

Copy link

jtdetwiler commented Jan 16, 2018

The fix above worked for me. Make sure you're admin when you run and don't see an access denied message.

@sbalbach

This comment has been minimized.

Copy link
Author

sbalbach commented Jan 17, 2018

I'm not sure what happened but Docker is now working for me. Possibly a reboot after running the MOFCOMP command fixed it.

@sbalbach sbalbach closed this Jan 17, 2018

@martinmose

This comment has been minimized.

Copy link

martinmose commented Apr 23, 2018

Running this command: (Command Prompt as administrator)
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

and then restarted fixet it for me aswell. Thanks :).

@ericis

This comment has been minimized.

Copy link

ericis commented Jul 9, 2018

I ran (as admin) and restarted and still get the error. I've gone so far as to install the linux subsystem for Windows 10, install Ubuntu, and try to install docker inside, but am having endless issues there too.

(... just want to run a local redis instance on docker 👎 ...)

@sbalbach

This comment has been minimized.

Copy link
Author

sbalbach commented Jul 9, 2018

I have two Win10 machines. Docker starts fine on one every time. The other only works occasionally. When it doesn't work, I found that if I stop and start Virtual Machine Management Service from Window's Task Manager and then kill Docker and start it again, it works.

@mansur-shaik

This comment has been minimized.

Copy link

mansur-shaik commented Aug 10, 2018

Guys, If it says,
Stopped with error:
"ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual switch with name "DockerNAT".
at New-Switch, : line 117
at , : line 394
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\gopath\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:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 67
at Docker.Actions.<>c__DisplayClass14_0.b__0() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 51
at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

  1. Uninstall docker from system, re-install it.
  2. Open cmd from windows right click it, Run as Admininstator.
  3. Paste this on command prompt
    MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof
  4. Bam, there you go. Docker will start now.

Hope it helps.

@hfakar

This comment has been minimized.

Copy link

hfakar commented Aug 14, 2018

It doesnt fix it.

@kcsham

This comment has been minimized.

Copy link

kcsham commented Aug 31, 2018

I really just want to reset everything and start from scratch. After an upgrade from 17.x to 18.x, it is just broken. My hyper-v can still spin up VM and seemingly functioning. Docker, this is wide-spread and damaging. Please fix or provide a solution.

@amarquezp

This comment has been minimized.

Copy link

amarquezp commented Sep 6, 2018

I faced the same issue and the way I make it work again:

  1. Delete all the Hyper-V Virtual Adapters; my guess is that those were created using some Windows 10 config non compatible with Windows updates :
    1.1 Open Device Manager > Network Adapters
    1.2 Delete/Uninstall each Hyper-V Virtual Adapter
    1.3 Restart Windows
  2. Uninstall Docker (I think this will clean old configurations)
  3. Reinstall Docker
  4. Restart Windows
@QuinnEbert

This comment has been minimized.

Copy link

QuinnEbert commented Sep 11, 2018

Confirming that the recommended steps from @amarquezp work for me, although I ran the following suggested command with Admin-elevated PowerShell between his steps 2 and 3 and did not restart Windows:

MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

This is on Windows 10 / 1803 with Docker for Windows Version 18.06.1-ce-win73 (19507).

@kcsham

This comment has been minimized.

Copy link

kcsham commented Sep 14, 2018

@amarquezp post (link below) solved the issue for me too. I didn't have to the step 4 and docker was able to run.

#1538 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.