for-win icon indicating copy to clipboard operation
for-win copied to clipboard

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual machine with name "MobyLinuxVM".

Open Majed93 opened this issue 9 years ago • 15 comments

Expected behavior

Docker starts successfully.

Actual behavior

Docker fails to start.

Information

  • Diagnostic ID : 5B51E731-80AB-44B2-9D06-CCD9C1B1D30E/2017-03-14_22-03-52
  • Windows 10 Education. 1607. Build 14393

Getting this error when running docker. 'Unable to download logs: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual machine with name "MobyLinuxVM".'

[22:02:12.033][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: Element not found.

    at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
   at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
   at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)
[22:02:12.365][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: Element not found.


[22:02:12.365][Notifications  ][Error  ] Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Element not found.

Reinstalled many times. Noticed that in my Hyper-V manager there's no MobyLinuxVM? Tried to manually add it by selecting .iso in the resources folder but no luck. Also noticed there's no DockerNAT network adapter? I think my Hyper-V might have messed up but not sure how to 'reset' it :(

Steps to reproduce the behavior

Run Docker.

Majed93 avatar Mar 14 '17 22:03 Majed93

Experiencing the same issue - also on build 14393

tomesposito92 avatar Mar 15 '17 19:03 tomesposito92

Tried these commands

 .\MobyLinux.ps1 -Destroy
 .\MobyLinux.ps1 -Create

But during create, it'll create the switch then throw this

New-NetIPAddress : Element not found.
At C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:164 char:23
+ ... rkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAd ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_NetIPAddress:ROOT/StandardCimv2/MSFT_NetIPAddress) [New-NetIPAddress], CimException
    + FullyQualifiedErrorId : Windows System Error 1168,New-NetIPAddress

Majed93 avatar Mar 15 '17 20:03 Majed93

Also got this problem.

Windows 10 VM Name : WINDOWS10-ON-SE Host Operating System : Windows Server 2016 OS: Windows 10 Pro Edition: Professional Id: 1607 Build: 14393 BuildLabName: 14393.953.amd64fre.rs1_release_inmarket.170303-1614

Crash Report :- 2F5FE5D1-214B-4B19-9764-CE5F5036E5C6/2017-03-22_23-03-54

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The computer 'WINDOWS10-ON-SE' could not be resolved. Make sure you typed the machine name correctly and that you have network access. at Get-Vhd-Root, : line 93 at New-MobyLinuxVM, : line 214 at , : line 381 at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters) at Docker.Backend.ContainerEngine.Linux.Start(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.b__0(Object[] parameters) at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

NPrice99 avatar Mar 22 '17 23:03 NPrice99

I've 'refreshed' windows 10, i think my hyper-v was messed up. All working now.

Majed93 avatar Mar 23 '17 19:03 Majed93

I had the same experience - I think perhaps this points to needing better error reporting if the Hyper-V VM cannot be started.

justinian avatar Mar 23 '17 20:03 justinian

Is there a released version with this fix?

charlesritchea avatar Jun 23 '17 18:06 charlesritchea

I was also facing the same issue but it was random in nature, I found it is due to some inaccessibility of network card by the docker start script. This inaccessibility further blocks the start up process of docker.

I found one hack and it is working fine on my windows machine

Hack

Open C:\Program Files\Docker\Docker\resources\mobylinux.ps1 with any editor in admin mode. Find following code (around line 164)

 $networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

Add a return after line 165 in a new line like below and save the file.

$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

return

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

Now restart docker and after restart completion execute following commands in dos admin mode to setup the network card manually

netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0

You have to run this command every time whenever you are doing system restart and docker completes start process (due to any reason). TIP : create a batch file of this command and save somewhere handy.

Note: The ps hack would get undone by any docker update. so be aware...

mukeshkagarwal avatar Jul 14 '17 09:07 mukeshkagarwal

When I execute netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0 I get The filename, directory name, or volume label syntax is incorrect.

Mattacks avatar Jul 26 '17 10:07 Mattacks

I applied the hack from @mukeshkagarwal, and this way I got my Docker working. Thanks!

The only problem is that the command netsh interface ipv4 set address name="vEthernet (DockerNAT)" static 10.0.75.1 255.255.255.0 failed with message Element not found.. This is actually the same message I got in Docker error report, so this seems to be the issue. In order to check that I typed netsh interface ipv4 show interfaces, but there was no vEthernet (DockerNAT). I found it in Control Panel\Network and Internet\Network Connections window and applied the settings manually in GUI window.

mstankie avatar Aug 16 '17 14:08 mstankie

quick fix : run docker as Administrator. Seems like authorization issues.

butthe4d avatar Nov 14 '17 10:11 butthe4d

This doesnt have any connection with the windows edition of the user? Seems like HYPER-V can only be installed on Windows 10 Pro+ https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v

vico93 avatar Dec 04 '17 02:12 vico93

Hi guys!

I solved my problem openning the Hyper-V and applying the right directory for my HD and Conf folders. To check if it's your problem as well, please follow the steps:

1 - Open Hyper-V 2 - Right-click on the virtual machine (if you have it already created) 3 - Click on Hyper-V settings 4 - Check the "Virtual Hard Disk" and "Virtual Machine" directories.

I started to have this issue after trying to change my files to another directory.

edjostenes avatar Jul 25 '19 13:07 edjostenes

I would get this message every time I logged in. I finally solved it simply by opening the Hyper-V console and stopping and then restarting the service. I suppose rebooting would accomplish the same thing.

cgodkin avatar Nov 06 '19 14:11 cgodkin

This fixed the issue for me and its so amazing :)

https://stackoverflow.com/questions/54181239/unable-to-start-the-running-command-stopped-because-the-preference-variable-er/54485998#54485998

shravanar avatar Jan 14 '20 08:01 shravanar

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked

docker-robott avatar Jun 21 '20 03:06 docker-robott