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

Problem with running Docker for Windows (Hyper-v) plus updated info

Open Phoenyx33 opened this issue 9 years ago • 12 comments

Expected behavior

Docker should run.

Actual behavior

Docker crashes with error info as below.

Information

  • Diagnostic ID from "Diagnose & Feedback" in the menu. 2CA89324-0D8B-4274-B40C-2B2670824C47/2017-01-19_19-27-08
  • a reproducible case if this is a bug, Dockerfiles FTW Info as in Issue #27, #28 and others.
  • page URL if this is a docs issue or the name of a man page
  • host distribution and version (Windows version, build number, etc) Windows 10 Pro Version 1607 (OS Build 14393.576)

Steps to reproduce the behavior

  1. install dockerinstall.msi (version 1.13.0), after reboots to install hyper-v at first start and any attempt to start afterwards Docker crashes with error as below and in diagnostic.
  2. Having no luck with the normal install, I looked in the Docker\resources directory and noticed the mobylinux.ps1 file. Trying to understand what was happening I read thru it and then tried do it by hand. As I was doing this, I found that attaching the mobylinux.iso for the vm to boot from and then starting the vm that it would not read from the iso, stating "Boot failure. Reboot and Select proper Boot device or Insert Boot Media in selected Boot device". Checking the logs right after that happened it was giving the error that everyone seems to be having problems with, as follows... "Unable to stop: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Invalid class

at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters) at Docker.Backend.ContainerEngine.Linux.DoStop() at Docker.Backend.ContainerEngine.Linux.Restart(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.b__0(Object[] parameters) at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)"

Could the invalid mobylinux.iso be doing this? Or is there a service used to read iso's as DVD's that is defaulted to "Off/Stop"?

Phoenyx33 avatar Jan 20 '17 01:01 Phoenyx33

Try editing you MobyLinux.ps1 script at line 250 by replacing

$vm | Set-VMFirmware -EnableSecureBoot Off -BootOrder $vm.DVDDrives

with these 2 lines

$iso = $vm | Get-VMFirmware | select -ExpandProperty BootOrder | where {$_.FirmwarePath.EndsWith("Scsi(0,1)")}
    $vm | Set-VMFirmware -EnableSecureBoot Off -FirstBootDevice $iso

Fixed my issue #400

richraid21 avatar Jan 20 '17 02:01 richraid21

That might be worth a PR!? Thanks @richraid21!

fredericrous avatar Jan 23 '17 10:01 fredericrous

Unfortunately for me, that didn't work either, Rich. As I commented in someone else's issue, at least the Docker Toolbox does work for me. Only the Docker for Windows (ie. the hyper-v version) refuses to work.

On a side note, when Microsoft's new update (Creator's Update? Whatever...) is probably going to cause even more problems. I wonder if I can get the Ubuntu version working under Bash4Ubuntu4Windows?

ThePhoenyx avatar Jan 26 '17 05:01 ThePhoenyx

Have the same issue Editing the MobyLinux.ps1 script as suggested didn't solve the issue ID - 52540761-A3D5-4CB1-A7EE-12326EB7A457/2017-01-29_15-05-40 Any resolution on this?

yossi-neeman avatar Jan 29 '17 13:01 yossi-neeman

9A957E8A-0E58-43D7-87A0-735A8321CCED/2017-03-23_11-45-55

andywhitt avatar Mar 23 '17 11:03 andywhitt

I just tried it again with the latest stable for win, no joy. Here's the new crash report: 2CA89324-0D8B-4274-B40C-2B2670824C47/2017-05-29_17-52-13 I'd really like to use the hyper-v version, as I can run other VM's in hyper-V (and they run).

Phoenyx33 avatar May 29 '17 22:05 Phoenyx33

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 everytime 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

I'd like to thank everyone for trying to help with this issue. I still don't know what caused it, but yesterday I had the "creator's" update get to my machine. After the update was all said and done, I tried again, useing the available "Edge" install and although Docker took about a minute and a half to finish starting, it did in the end start, run Hello-world worked properly and and old image on the machine ran as well. Whatever the problem was it seems to have been with the Anniversary update and the new update has fixed it for me. I don't know if I should leave this open for all the other people who have the problem or close it. I'll leave that up to dgageot and the other mods to let me know. Again, thanks to all.

Phoenyx33 avatar Jul 21 '17 01:07 Phoenyx33

I did the following:

  1. Uninstall the docker
  2. Delete all network adapters related to the hypervisor.
  3. Re-install the docker And now it works fine.

a-baldov avatar Aug 31 '17 10:08 a-baldov

Here is what I did uninstalled Docker and after a) and b) installed it again. a) uninstalled Forticlient (which I wasn't using anyway) b) from device manager uninstalled all disabled Hyper-V network adapters Not sure which one of two did the trick but I bet on later. Docker reinstall might not necessary as I well.

MihaMarkic avatar Sep 15 '17 07:09 MihaMarkic

Closing this one - this is a Hyper-V network issue resolved by using the cleanup script here: https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/live/windows-server-container-tools/CleanupContainerHostNetworking

jasonbivins avatar Dec 06 '17 17:12 jasonbivins

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 20 '20 03:06 docker-robott