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

Cannot connect to Docker Server on Win10 Pro #515

Closed
nickiannone opened this Issue Feb 21, 2017 · 13 comments

Comments

Projects
None yet
5 participants
@nickiannone

nickiannone commented Feb 21, 2017

Expected behavior

Docker client and server start, docker version lists version numbers for both

Actual behavior

Docker client starts, cannot connect to server. Lists connection failure (see Steps to reproduce, below)

Information

  • Diagnostic ID: 78D68BD1-7D5F-4BA9-A112-83223AEB6A58/2017-02-21_10-41-37
  • Following https://docs.docker.com/docker-for-windows/
  • Windows 10 Pro (10.0.14393)
  • Docker version 1.13.1, build 092cba3
  • Docker-compose version 1.11.1, build 7afaa436
  • Docker-machine version 0.9.0, build 15fd4c7

Steps to reproduce the behavior

  1. Install Docker for Windows (stable) from https://www.docker.com/products/docker#/windows
  2. Start Docker for Windows
  3. Run docker version in cmd.exe or Powershell
  4. Observe following output:
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      windows/amd64
error during connect: Get http://127.0.0.1:2376/v1.26/version: dial tcp 127.0.0.1:2376: connectex: No connection could be made because the target machine actively refused it.
@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone commented Feb 21, 2017

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

In administrative PowerShell, ran the following command to test: wget https://github.com/Microsoft/Virtualization-Documentation/raw/master/windows-server-container-tools/Debug-ContainerHost/Debug-ContainerHost.ps1 -UseBasicParsing | iex

Received the following output:

Describing Windows Version and Prerequisites
 [+] Is Windows 10 Anniversary Update or Windows Server 2016 66ms
 [+] Has KB3192366, KB3194496, or later installed if running Windows build 14393 18ms
 [+] Is not a build with blocking issues 17ms
 [+] Has 'Containers' feature installed 1.92s
Describing Docker is installed
 [+] A Docker service is installed - 'Docker' or 'com.Docker.Service'  30ms
 [+] Service is running 12ms
 [+] Docker.exe is in path 6.04s
 [+] Docker is registered in the EventLog service 59ms
Describing User has permissions to use Docker daemon
 [+] docker.exe should not return access denied 23ms
Describing Windows container settings are correct
 [+] Do not have DisableVSmbOplock set to 1 23ms
 [+] Do not have zz values set 29ms
Describing The right container base images are installed
error during connect: Get http://127.0.0.1:2376/v1.26/images/json: dial tcp 127.0.0.1:2376: connectex: No connection could be made because the target machine actively refused it.
 [-] At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed 2.09s
   ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   ParameterBindingValidationException: Cannot validate argument on parameter 'Property'. The argument is null or empty.
 Provide an argument that is not null or empty, and then try the command again.
   at <ScriptBlock>, <No file>: line 109
Describing Container network is created
 [+] At least one local container network is available 3.04s
 [-] At least one NAT, Transparent, or L2Bridge Network exists 15ms
   Expected {0} to be greater than {0}
   200:       $totalnets | Should BeGreaterThan 0
   at <ScriptBlock>, <No file>: line 200
 [-] NAT Network's vSwitch is internal 19ms
   Expected: {Internal}
   But was:  {}
   205:       $switchType | Should Be "Internal"
   at <ScriptBlock>, <No file>: line 205
 [-] Specified Network Gateway IP for NAT network is assigned to Host vNIC 20ms
   Expected: value to not be empty
   209:       $natGatewayIP | Should Not BeNullOrEmpty
   at <ScriptBlock>, <No file>: line 209
 [-] NAT Network's internal prefix does not overlap with external IP' 27ms
   Expected {0} to be greater than {0}
   236:         $hostips.Count | Should BeGreaterThan 0
   at <ScriptBlock>, <No file>: line 236
Logs saved to C:\WINDOWS\system32\logs_20170221-113334.csv

nickiannone commented Feb 21, 2017

In administrative PowerShell, ran the following command to test: wget https://github.com/Microsoft/Virtualization-Documentation/raw/master/windows-server-container-tools/Debug-ContainerHost/Debug-ContainerHost.ps1 -UseBasicParsing | iex

Received the following output:

Describing Windows Version and Prerequisites
 [+] Is Windows 10 Anniversary Update or Windows Server 2016 66ms
 [+] Has KB3192366, KB3194496, or later installed if running Windows build 14393 18ms
 [+] Is not a build with blocking issues 17ms
 [+] Has 'Containers' feature installed 1.92s
Describing Docker is installed
 [+] A Docker service is installed - 'Docker' or 'com.Docker.Service'  30ms
 [+] Service is running 12ms
 [+] Docker.exe is in path 6.04s
 [+] Docker is registered in the EventLog service 59ms
Describing User has permissions to use Docker daemon
 [+] docker.exe should not return access denied 23ms
Describing Windows container settings are correct
 [+] Do not have DisableVSmbOplock set to 1 23ms
 [+] Do not have zz values set 29ms
Describing The right container base images are installed
error during connect: Get http://127.0.0.1:2376/v1.26/images/json: dial tcp 127.0.0.1:2376: connectex: No connection could be made because the target machine actively refused it.
 [-] At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed 2.09s
   ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
   ParameterBindingValidationException: Cannot validate argument on parameter 'Property'. The argument is null or empty.
 Provide an argument that is not null or empty, and then try the command again.
   at <ScriptBlock>, <No file>: line 109
Describing Container network is created
 [+] At least one local container network is available 3.04s
 [-] At least one NAT, Transparent, or L2Bridge Network exists 15ms
   Expected {0} to be greater than {0}
   200:       $totalnets | Should BeGreaterThan 0
   at <ScriptBlock>, <No file>: line 200
 [-] NAT Network's vSwitch is internal 19ms
   Expected: {Internal}
   But was:  {}
   205:       $switchType | Should Be "Internal"
   at <ScriptBlock>, <No file>: line 205
 [-] Specified Network Gateway IP for NAT network is assigned to Host vNIC 20ms
   Expected: value to not be empty
   209:       $natGatewayIP | Should Not BeNullOrEmpty
   at <ScriptBlock>, <No file>: line 209
 [-] NAT Network's internal prefix does not overlap with external IP' 27ms
   Expected {0} to be greater than {0}
   236:         $hostips.Count | Should BeGreaterThan 0
   at <ScriptBlock>, <No file>: line 236
Logs saved to C:\WINDOWS\system32\logs_20170221-113334.csv
@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

Found a solution to docker version by messing around with docker-machine. Turns out my install process somehow didn't create a default machine using the appropriate driver (note that I did have Oracle VirtualBox AND Hyper-V installed, and was able to get the Hyper-V manager running, and it showed a single MobyLinux VM on my system). Here's what I did to get it running (in administrative Powershell). (NOTE: Replace my-machine with the desired name of the VM.)

docker-machine create --driver hyperv my-machine
docker-machine env my-machine | Invoke-Expression
docker version

This does NOT solve the problem; any attempts to use docker fail with a message such as this:

time="2017-02-21T13:58:24-06:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"

nickiannone commented Feb 21, 2017

Found a solution to docker version by messing around with docker-machine. Turns out my install process somehow didn't create a default machine using the appropriate driver (note that I did have Oracle VirtualBox AND Hyper-V installed, and was able to get the Hyper-V manager running, and it showed a single MobyLinux VM on my system). Here's what I did to get it running (in administrative Powershell). (NOTE: Replace my-machine with the desired name of the VM.)

docker-machine create --driver hyperv my-machine
docker-machine env my-machine | Invoke-Expression
docker version

This does NOT solve the problem; any attempts to use docker fail with a message such as this:

time="2017-02-21T13:58:24-06:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

More progress.

After cleaning up the docker machine I created via docker-machine rm my-machine, and disabling Hyper-V in Windows via the Powershell command Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All (NOT a typo, there's actually no space in Microsoft-Hyper-V-All), I was able to try again using Oracle VirtualBox. (NOTE that disabling Hyper-V will restart your computer.)

The commands are the same for setting up with VirtualBox (assuming you have it installed), using administrative PowerShell:

docker-machine create --driver virtualbox my-machine
docker-machine env my-machine | Invoke-Expression
docker version

As a side note, I'm using VirtualBox v5.1.14r112924 (Qt5.6.2), according to the About VirtualBox dialog.

This allows me to invoke docker run hello-world successfully, though the above error regarding the system certificate pool does still occur.

nickiannone commented Feb 21, 2017

More progress.

After cleaning up the docker machine I created via docker-machine rm my-machine, and disabling Hyper-V in Windows via the Powershell command Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All (NOT a typo, there's actually no space in Microsoft-Hyper-V-All), I was able to try again using Oracle VirtualBox. (NOTE that disabling Hyper-V will restart your computer.)

The commands are the same for setting up with VirtualBox (assuming you have it installed), using administrative PowerShell:

docker-machine create --driver virtualbox my-machine
docker-machine env my-machine | Invoke-Expression
docker version

As a side note, I'm using VirtualBox v5.1.14r112924 (Qt5.6.2), according to the About VirtualBox dialog.

This allows me to invoke docker run hello-world successfully, though the above error regarding the system certificate pool does still occur.

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

More weirdness. Oracle VirtualBox UI shows the machine in the list of VMs, but it remains powered off.

Invoking docker run -it ubuntu bash worked, but I was unable to figure out how to exit the bash prompt without closing the Powershell window.

After opening a new administrative Powershell window, even more weirdness:

  • docker version results in a similar error as before, with the client version coming back fine and the server version info listing a connectex: No connection could be made because the target machine actively refused it. error.
  • docker-machine active lists No active host found
  • docker-machine start my-machine lists "my-machine" is already running.
  • docker-machine env my-machine correctly lists the env parameters for the machine.
  • docker-machine stop my-machine lists:
Stopping "my-machine"...
"my-machine" was stopped.
  • docker-machine start my-machine then restarts the machine normally, with a message about needing to re-run the docker-machine env command.
  • After re-running docker-machine env my-machine | Invoke-Expression, subsequent calls to docker version successfully list the client and server versions.

Could this have to do with the scope of the environment variables, perhaps?

nickiannone commented Feb 21, 2017

More weirdness. Oracle VirtualBox UI shows the machine in the list of VMs, but it remains powered off.

Invoking docker run -it ubuntu bash worked, but I was unable to figure out how to exit the bash prompt without closing the Powershell window.

After opening a new administrative Powershell window, even more weirdness:

  • docker version results in a similar error as before, with the client version coming back fine and the server version info listing a connectex: No connection could be made because the target machine actively refused it. error.
  • docker-machine active lists No active host found
  • docker-machine start my-machine lists "my-machine" is already running.
  • docker-machine env my-machine correctly lists the env parameters for the machine.
  • docker-machine stop my-machine lists:
Stopping "my-machine"...
"my-machine" was stopped.
  • docker-machine start my-machine then restarts the machine normally, with a message about needing to re-run the docker-machine env command.
  • After re-running docker-machine env my-machine | Invoke-Expression, subsequent calls to docker version successfully list the client and server versions.

Could this have to do with the scope of the environment variables, perhaps?

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

After adding the environment variables listed by docker-machine env my-machine to my User Variables in Windows, and re-launching both a user-level and administrative PowerShell window, I've eliminated all but the pesky system certificate pool error. docker-machine active correctly shows my-machine as the active machine, and docker version lists the client and server versions.

Not sure if this is stable, or if there are any other issues at play here, but this at least gives me the ability to load and run docker images on Windows without critical failure.

nickiannone commented Feb 21, 2017

After adding the environment variables listed by docker-machine env my-machine to my User Variables in Windows, and re-launching both a user-level and administrative PowerShell window, I've eliminated all but the pesky system certificate pool error. docker-machine active correctly shows my-machine as the active machine, and docker version lists the client and server versions.

Not sure if this is stable, or if there are any other issues at play here, but this at least gives me the ability to load and run docker images on Windows without critical failure.

@dgageot

This comment has been minimized.

Show comment
Hide comment
@dgageot

dgageot Feb 21, 2017

@nickiannone Docker Machine and Docker for Windows don't mix well. If you have window 10 Pro, you should really get rid of Machine and use Docker for Windows.
If you decide to do that, make sure you don't have any environment variable pointing to a docker machine host. It's mandatory for Machine but will break Docker for Windows. You initial description makes me think you had D4W properly installed but with an env variable leftover.

dgageot commented Feb 21, 2017

@nickiannone Docker Machine and Docker for Windows don't mix well. If you have window 10 Pro, you should really get rid of Machine and use Docker for Windows.
If you decide to do that, make sure you don't have any environment variable pointing to a docker machine host. It's mandatory for Machine but will break Docker for Windows. You initial description makes me think you had D4W properly installed but with an env variable leftover.

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 21, 2017

See, that's the issue; I tried installing Docker for Windows, and couldn't get it to work properly! I'm not sure if it was VirtualBox not playing nice with the Docker for Windows installer, but it just couldn't connect to the server. I can try wiping my system clean of Hyper-V, Vbox, and both docker-machine and D4W, then starting over fresh, as I think that should work, but I managed to at least get something working that I can manage via PowerShell. I'm not entirely sure which one it is, though.

I can try that, and if need be, go back and recreate the scenario I've stumbled into if it doesn't work.

nickiannone commented Feb 21, 2017

See, that's the issue; I tried installing Docker for Windows, and couldn't get it to work properly! I'm not sure if it was VirtualBox not playing nice with the Docker for Windows installer, but it just couldn't connect to the server. I can try wiping my system clean of Hyper-V, Vbox, and both docker-machine and D4W, then starting over fresh, as I think that should work, but I managed to at least get something working that I can manage via PowerShell. I'm not entirely sure which one it is, though.

I can try that, and if need be, go back and recreate the scenario I've stumbled into if it doesn't work.

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 22, 2017

Well, I've managed to break things further. Uninstalling and reinstalling D4W via Windows Add/Remove Programs did not work. Through an uninstall script I located here (https://forums.docker.com/t/cannot-uninstall-docker-for-windows/15661/11), I was able to clear out most of the problems, but it seems as though I've introduced more. Here's the script I used:

# Shut down and destroy the MobyLinux VM.
pushd "C:\Program Files\Docker\Docker\Resources"
& ./MobyLinux.ps1 -Destroy
popd
# Destroy the new-style service
$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'"
$service.StopService()
$service.Delete()
kill -processname com.docker.service
Start-Sleep -s 5
# Delete files
Remove-Item -Recurse -Force "~/AppData/Local/Docker"
Remove-item -Recurse -Force "~/AppData/Roaming/Docker"
takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y
icacls "C:\ProgramData\Docker" /T /C /grant Administrators:F
Remove-Item -Recurse -Force "C:\ProgramData\Docker"
Remove-Item -Recurse -Force "C:\Program Files\Docker"
Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker"
Remove-Item -Recurse -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
Remove-Item -Recurse -Force "~\.docker"
Remove-Item -Recurse -Force "~\DockerSwarm"
# Modify registry
Get-ChildItem hklm:\software\microsoft\windows\currentversion\uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force
Get-ChildItem hklm:\software\classes\installer\products | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object {$_.ProductName -eq "Docker"} | Remove-Item -Recurse -Force
Get-Item 'hklm:\software\Docker Inc.' | Remove-Item -Recurse -Force
Get-ItemProperty -path hkcu:\software\microsoft\windows\currentversion\Run -Name "Docker for Windows" | Remove-Item -Recurse -Force
# Remove env variables used by docker-machine
Get-Item Env:\COMPOSE_CONVERT_WINDOWS_PATHS | Remove-Item
Get-Item Env:\DOCKER_* | Remove-Item # DOCKER_CERT_PATH, DOCKER_HOST, DOCKER_MACHINE_NAME, DOCKER_TLS_VERIFY

I was able to uninstall D4W and clean up what I thought was everything. Unfortunately, this only made things worse; after reinstalling D4W stable from the MSI package, and running I get the following errors:

PS C:\WINDOWS\system32> docker --version
time="2017-02-22T13:49:47-06:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
could not read CA certificate "C:\\Users\\my-user\\.docker\\machine\\machines\\my-machine\\ca.pem": open C:\Users\my-user\.docker\machine\machines\my-machine\ca.pem: The system cannot find the path specified.

Running docker-machine --version and docker-compose --version returns proper values.

When I run gcm docker in Powershell, I get the following:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     docker.exe                                         1.13.1.0   C:\Program Files\Docker\Docker\Resources\bin\docker.exe

So docker is pointing to the right location, but either the configuration is wrong and it's trying to look for certs in the wrong place, or it's expecting stuff in ~/.docker to be there, and the installer is not recreating that folder properly.

What can I do to fix this and get back to the ideal solution of "no Vbox, no Machine, yes D4W, yes HyperV"?

nickiannone commented Feb 22, 2017

Well, I've managed to break things further. Uninstalling and reinstalling D4W via Windows Add/Remove Programs did not work. Through an uninstall script I located here (https://forums.docker.com/t/cannot-uninstall-docker-for-windows/15661/11), I was able to clear out most of the problems, but it seems as though I've introduced more. Here's the script I used:

# Shut down and destroy the MobyLinux VM.
pushd "C:\Program Files\Docker\Docker\Resources"
& ./MobyLinux.ps1 -Destroy
popd
# Destroy the new-style service
$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'"
$service.StopService()
$service.Delete()
kill -processname com.docker.service
Start-Sleep -s 5
# Delete files
Remove-Item -Recurse -Force "~/AppData/Local/Docker"
Remove-item -Recurse -Force "~/AppData/Roaming/Docker"
takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y
icacls "C:\ProgramData\Docker" /T /C /grant Administrators:F
Remove-Item -Recurse -Force "C:\ProgramData\Docker"
Remove-Item -Recurse -Force "C:\Program Files\Docker"
Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker"
Remove-Item -Recurse -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
Remove-Item -Recurse -Force "~\.docker"
Remove-Item -Recurse -Force "~\DockerSwarm"
# Modify registry
Get-ChildItem hklm:\software\microsoft\windows\currentversion\uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force
Get-ChildItem hklm:\software\classes\installer\products | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object {$_.ProductName -eq "Docker"} | Remove-Item -Recurse -Force
Get-Item 'hklm:\software\Docker Inc.' | Remove-Item -Recurse -Force
Get-ItemProperty -path hkcu:\software\microsoft\windows\currentversion\Run -Name "Docker for Windows" | Remove-Item -Recurse -Force
# Remove env variables used by docker-machine
Get-Item Env:\COMPOSE_CONVERT_WINDOWS_PATHS | Remove-Item
Get-Item Env:\DOCKER_* | Remove-Item # DOCKER_CERT_PATH, DOCKER_HOST, DOCKER_MACHINE_NAME, DOCKER_TLS_VERIFY

I was able to uninstall D4W and clean up what I thought was everything. Unfortunately, this only made things worse; after reinstalling D4W stable from the MSI package, and running I get the following errors:

PS C:\WINDOWS\system32> docker --version
time="2017-02-22T13:49:47-06:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
could not read CA certificate "C:\\Users\\my-user\\.docker\\machine\\machines\\my-machine\\ca.pem": open C:\Users\my-user\.docker\machine\machines\my-machine\ca.pem: The system cannot find the path specified.

Running docker-machine --version and docker-compose --version returns proper values.

When I run gcm docker in Powershell, I get the following:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     docker.exe                                         1.13.1.0   C:\Program Files\Docker\Docker\Resources\bin\docker.exe

So docker is pointing to the right location, but either the configuration is wrong and it's trying to look for certs in the wrong place, or it's expecting stuff in ~/.docker to be there, and the installer is not recreating that folder properly.

What can I do to fix this and get back to the ideal solution of "no Vbox, no Machine, yes D4W, yes HyperV"?

@nickiannone

This comment has been minimized.

Show comment
Hide comment
@nickiannone

nickiannone Feb 22, 2017

Progress.

After uninstalling VirtualBox and futzing with the docker-machine settings some more (which turned into another dead end), I found a similar PowerShell script in "C:\Program Files\Docker\Docker\resources\ForceRemoveDocker.ps1", and was able to modify it to suit my purposes and clean everything out properly. Below is my custom removal file:

$ErrorActionPreference = "SilentlyContinue"

kill -force -processname 'Docker for Windows', com.docker.db, com.docker.slirp, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd
kill -force -processname com.docker.service

try {
	pushd "C:\Program Files\Docker\Docker\Resources"
    ./MobyLinux.ps1 -Destroy
	popd
} Catch {}

$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'"
if ($service) { $service.StopService() }
if ($service) { $service.Delete() }
Start-Sleep -s 5
Remove-Item -Recurse -Force "~/AppData/Local/Docker"
Remove-Item -Recurse -Force "~/AppData/Roaming/Docker"
if (Test-Path "C:\ProgramData\Docker") { takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y }
if (Test-Path "C:\ProgramData\Docker") { icacls "C:\ProgramData\Docker\" /T /C /grant Administrators:F }
Remove-Item -Recurse -Force "C:\ProgramData\Docker"
Remove-Item -Recurse -Force "C:\Program Files\Docker"
Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker"
Remove-Item -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
Remove-Item -Recurse -Force "~\.docker"
Remove-Item -Recurse -Force "~\DockerSwarm"
Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force
Get-ChildItem HKLM:\software\classes\installer\products | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.ProductName -eq "Docker" } | Remove-Item -Recurse -Force
Get-Item 'HKLM:\software\Docker Inc.' | Remove-Item -Recurse -Force
# TODO Figure out how to do these properly!
# Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\Run -name "Docker for Windows" | Remove-Item -Recurse -Force
# Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | ForEach-Object {Get-ItemProperty $_.PSPath} | Where-Object { $_.ToString().Contains("Docker for Windows.exe") } | Remove-Item -Recurse -Force

# Remove env variables used by docker-machine
Get-Item Env:\COMPOSE_CONVERT_WINDOWS_PATHS | Remove-Item
Get-Item Env:\DOCKER_* | Remove-Item # DOCKER_CERT_PATH, DOCKER_HOST, DOCKER_MACHINE_NAME, DOCKER_TLS_VERIFY

After executing this script, reinstalling D4W from the Installer, and waiting for it to show the "Docker is now up and running!" prompt, everything works as expected.

  • Running docker version shows client and server versions correctly.
  • Running docker run hello-world pulls the Hello World image, mounts it, and shows the success message.

nickiannone commented Feb 22, 2017

Progress.

After uninstalling VirtualBox and futzing with the docker-machine settings some more (which turned into another dead end), I found a similar PowerShell script in "C:\Program Files\Docker\Docker\resources\ForceRemoveDocker.ps1", and was able to modify it to suit my purposes and clean everything out properly. Below is my custom removal file:

$ErrorActionPreference = "SilentlyContinue"

kill -force -processname 'Docker for Windows', com.docker.db, com.docker.slirp, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd
kill -force -processname com.docker.service

try {
	pushd "C:\Program Files\Docker\Docker\Resources"
    ./MobyLinux.ps1 -Destroy
	popd
} Catch {}

$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'"
if ($service) { $service.StopService() }
if ($service) { $service.Delete() }
Start-Sleep -s 5
Remove-Item -Recurse -Force "~/AppData/Local/Docker"
Remove-Item -Recurse -Force "~/AppData/Roaming/Docker"
if (Test-Path "C:\ProgramData\Docker") { takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y }
if (Test-Path "C:\ProgramData\Docker") { icacls "C:\ProgramData\Docker\" /T /C /grant Administrators:F }
Remove-Item -Recurse -Force "C:\ProgramData\Docker"
Remove-Item -Recurse -Force "C:\Program Files\Docker"
Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker"
Remove-Item -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
Remove-Item -Recurse -Force "~\.docker"
Remove-Item -Recurse -Force "~\DockerSwarm"
Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force
Get-ChildItem HKLM:\software\classes\installer\products | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object { $_.ProductName -eq "Docker" } | Remove-Item -Recurse -Force
Get-Item 'HKLM:\software\Docker Inc.' | Remove-Item -Recurse -Force
# TODO Figure out how to do these properly!
# Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\Run -name "Docker for Windows" | Remove-Item -Recurse -Force
# Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | ForEach-Object {Get-ItemProperty $_.PSPath} | Where-Object { $_.ToString().Contains("Docker for Windows.exe") } | Remove-Item -Recurse -Force

# Remove env variables used by docker-machine
Get-Item Env:\COMPOSE_CONVERT_WINDOWS_PATHS | Remove-Item
Get-Item Env:\DOCKER_* | Remove-Item # DOCKER_CERT_PATH, DOCKER_HOST, DOCKER_MACHINE_NAME, DOCKER_TLS_VERIFY

After executing this script, reinstalling D4W from the Installer, and waiting for it to show the "Docker is now up and running!" prompt, everything works as expected.

  • Running docker version shows client and server versions correctly.
  • Running docker run hello-world pulls the Hello World image, mounts it, and shows the success message.
@simonferquel

This comment has been minimized.

Show comment
Hide comment
@simonferquel

simonferquel Mar 1, 2017

This seem to have been resolved so (the problem seem to be related to a previous docker toolbox installation plus a VirtualBox / Hyper-V conflict).

Can I close the issue ?

simonferquel commented Mar 1, 2017

This seem to have been resolved so (the problem seem to be related to a previous docker toolbox installation plus a VirtualBox / Hyper-V conflict).

Can I close the issue ?

@friism

This comment has been minimized.

Show comment
Hide comment
@friism

friism Mar 10, 2017

Closing.

friism commented Mar 10, 2017

Closing.

@friism friism closed this Mar 10, 2017

@paladinram

This comment has been minimized.

Show comment
Hide comment
@paladinram

paladinram Mar 24, 2017

Please help on this error window 10..

Error dialing TCP: dial tcp 127.0.0.1:50075: connectex: No connection could be made because the target machine actively refused it

paladinram commented Mar 24, 2017

Please help on this error window 10..

Error dialing TCP: dial tcp 127.0.0.1:50075: connectex: No connection could be made because the target machine actively refused it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment