Docker Community Forums

Share and learn in the Docker community.

Cannot uninstall Docker for Windows

Hi guys,

sorry for the convenience.
Is one if you can show me the content of his uninstall log (in your User/AppData/Local/Docker dir, install-log-xxxx.txt, the oldest one after uninstalling the app) ?

I think that this is the oldest log since I’ve had the issues, but I’m not 100% sure. Looking at other logs I seem to get this error quite a bit:

[08:23:33.866][Installer ][Info ] Version: 1.11.1.3073
[08:23:33.867][Installer ][Info ] Starting on: 6/19/2016 8:23:33 AM
[08:23:33.867][Installer ][Info ] Resources: C:\Program Files\Docker\Docker\Resources
[08:23:33.868][Installer ][Info ] OS: Windows 10 Pro
[08:23:33.868][Installer ][Info ] Edition: Professional
[08:23:33.868][Installer ][Info ] Id: 1511
[08:23:33.869][Installer ][Info ] Build: 10586
[08:23:33.869][Installer ][Info ] BuildLabName: 10586.420.amd64fre.th2_release_sec.160527-1834
[08:23:33.872][Installer ][Info ] Sha1: 2fb5b031ee60c8a9b514883b54bcea8cf6d2ae8f
[08:23:34.172][Installer ][Info ] Killing processes…
[08:23:34.185][Installer ][Info ] Preparing upgrade…
[08:23:34.186][HyperV ][Info ] Destroy
[08:23:34.189][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True…
[08:23:34.856][Installer ][Error ] A parameter cannot be found that matches parameter name ‘KeepVolume’.

I’m getting the same issue on Windows 10 Pro. The installer becomes unresponsive and uncancellable at “Preparing Docker VM upgrade”

[17:35:19.572][Installer ][Info ] Version: 1.12.0.4760
[17:35:19.573][Installer ][Info ] Starting on: 7/9/2016 5:35:19 PM
[17:35:19.573][Installer ][Info ] Resources: C:\Program Files\Docker\Docker\Resources
[17:35:19.573][Installer ][Info ] OS: Windows 10 Pro
[17:35:19.573][Installer ][Info ] Edition: Professional
[17:35:19.574][Installer ][Info ] Id: 1511
[17:35:19.574][Installer ][Info ] Build: 10586
[17:35:19.574][Installer ][Info ] BuildLabName: 10586.420.amd64fre.th2_release_sec.160527-1834
[17:35:19.575][Installer ][Info ] Sha1: 999af1eac01deb75d9f166febb99a14b96b88ae3
[17:35:19.790][Installer ][Info ] Killing processes…
[17:35:19.795][Installer ][Info ] Preparing upgrade…
[17:35:19.795][HyperV ][Info ] Destroy
[17:35:19.802][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True…
[17:35:23.949][HyperV ][Info ] Kill VM MobyLinuxVM…
[17:35:23.964][HyperV ][Info ] VM MobyLinuxVM is stopped
[17:35:23.966][HyperV ][Info ] Destroying Switch DockerNAT…
[17:35:25.447][HyperV ][Info ] Destroying VM MobyLinuxVM…
[17:35:25.599][HyperV ][Info ] Keep VHD C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx
[17:35:25.601][Firewall ][Info ] Closing ports…
[17:35:26.125][Firewall ][Info ] Ports are closed
[17:35:26.126][HyperVGuids ][Info ] Removing GUIDs…
[17:35:26.126][HyperVGuids ][Info ] GUIDs removed
[17:35:26.126][Installer ][Info ] Prepare upgrade completed successfully

The same here.

Error 1714. The older version of Docker cannot be removed. Contact your technical support group. System Error 1612.
=== Logging stopped: 10/07/2016 18:51:26 ===

How is it possible that this is still an issue after a month? Can someone please release a fix for users stuck with a broken version of Docker?

EDIT: After deleting the contents of C:\Program Files\Docker and then downloading a fresh Docker MSI, then using the Remove option after it offers Repair or Remove, then finally reinstalling using that MSI, I was able to get around this issue and get the latest version of Docker installed.

1 Like

Sorry for the delay. I tried to reproduce this bug without success, so I wrote a script that will be ship in the next version but as you cannot uninstall, I dump here the procedure so you can install the latest version.

Open a powershell as administrator and copy/paste this script:

‘C:\Program Files\Docker\Docker\resources\MobyLinux.ps1’ -Destroy
$service = Get-WmiObject -Class Win32_Service -Filter “Name=‘com.docker.service’”
$service.StopService()
$service.Delete()
Start-Sleep -s 5
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 -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
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

And go to docker for windows page to install the lastest version, stable is 1.12.0 and beta is the same with experimental features enabled.

1 Like

Github issue: https://github.com/docker/docker/issues/24142

Merci Emmanuel

Just a couple of issues with the powershell script above.
Had issues running with the -Destroy parameter but just evaluetd the functions direct to be able to invoike directly the destroy functions (Stop-MobyLinuxVM, Destroy-Switch, Destroy-MobyLinuxVM).
In your for loop you miss the (underscore) for the current object variable ($) might be related to the message board app. I see it is with the underscore in the ForceRemoveDocker.ps1 of the new release.

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

Thank you again very much for this as it was quite annoying being stuck with the installer or uninstaller.

Cheers
Emmanuel

This worked for me. The first line had to have C:\...\MobyLinux.ps1 -Destroy, including the parameter, all in quotes.

I ran each line (or group of lines, like $service) as Admin

I’ve had to do this for every new beta update, do you know what causes it?

Still having this issue with the last update for Windows and we’re just a few days away from 2017. Sure feels like beta to me. I can’t update it, I can’t uninstall it, and the script doesn’t work for me (even with the edits the others offered). Can’t think of another piece of software where the uninstaller failed on me for some years now. Really, really disappointing effort from Docker. As much as I’d love to upload some log files and such I think I’ll just abstain and wait until this thing is fully baked. Can someone let me know when that happens?

1 Like

the same here, nothing works :confused:

Can you please post the content of the install log? Cannot uninstall Docker for Windows

Also consider opening an issue on https://github.com/docker/for-win/issues/new

Ok, so I have a bit of an update in dealing with this.

Through this post, and the discovery of the ForceRemoveDocker.ps1 PowerShell script (by default, “C:\Program Files\Docker\Docker\resources\ForceRemoveDocker.ps1” in Docker for Windows 1.13+ I believe), I was able to work through an issue with configuring Docker for Windows over top of a previous installation of Docker and VirtualBox.

The process I went through to get it to work is here: https://github.com/docker/for-win/issues/515#issuecomment-281819259

Hope this helps.

I was also unable to reinstall Docker (Community Edition) for Windows. I tried all the suggested PowerShell scripts suggested, but without success. The error message I got when installing ‘Stable’ and ‘Edge’ was not the same, and that helped me find this solution (a registry fix):
https://success.docker.com/KBase/Docker.For.Win_-_Install_fails_on_installationmanifest.json

Same problem here. When trying to install the latest community edition exe installer it thinks an older version still exists and prompts with “Do you want to replace your current version of Docker for Windows with this new one 17.09.0-ce-win33 (13620)?”. When I hit “yes” the main dialog simply says “Installation canceled”.

I tried all powershell scripts mentioned, tried manually blowing away anything to do with docker for windows on the file system as well as the registry, still same problem. Tried larshw’s link to remove a registry key but I didn’t have that key.

What registry key is this thing looking for??? I can’t figure it out. Installer log shows nothing of importance:

=== Verbose logging started: 10/11/2017  8:50:49  Build type: SHIP UNICODE 5.00.10011.00  Calling process: C:\Users\dan_000\Desktop\Docker for Windows Installer (2).exe ===
MSI (c) (B8:D0) [08:50:49:162]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (B8:D0) [08:50:49:162]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

MSI (c) (B8:FC) [08:50:49:170]: Resetting cached policy values
MSI (c) (B8:FC) [08:50:49:170]: Machine policy value 'Debug' is 0
MSI (c) (B8:FC) [08:50:49:170]: ******* RunEngine:
           ******* Product: {34B78221-C2E1-4AE3-9A3D-3DDD1E8A3E2F}
           ******* Action: 
           ******* CommandLine: **********
MSI (c) (B8:FC) [08:50:49:170]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (B8:FC) [08:50:49:170]: Grabbed execution mutex.
MSI (c) (B8:FC) [08:50:49:172]: Cloaking enabled.
MSI (c) (B8:FC) [08:50:49:172]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (B8:FC) [08:50:49:173]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (14:30) [08:50:49:176]: Running installation inside multi-package transaction {34B78221-C2E1-4AE3-9A3D-3DDD1E8A3E2F}
MSI (s) (14:30) [08:50:49:176]: Grabbed execution mutex.
MSI (s) (14:CC) [08:50:49:177]: Resetting cached policy values
MSI (s) (14:CC) [08:50:49:177]: Machine policy value 'Debug' is 0
MSI (s) (14:CC) [08:50:49:177]: ******* RunEngine:
           ******* Product: {34B78221-C2E1-4AE3-9A3D-3DDD1E8A3E2F}
           ******* Action: 
           ******* CommandLine: **********
MSI (s) (14:CC) [08:50:49:177]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (14:CC) [08:50:49:177]: MainEngineThread is returning 1605
MSI (s) (14:30) [08:50:49:178]: User policy value 'DisableRollback' is 0
MSI (s) (14:30) [08:50:49:178]: Machine policy value 'DisableRollback' is 0
MSI (s) (14:30) [08:50:49:178]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (14:30) [08:50:49:178]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (14:30) [08:50:49:179]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (14:30) [08:50:49:179]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (c) (B8:FC) [08:50:49:180]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.  Counter after decrement: -1
MSI (c) (B8:FC) [08:50:49:181]: MainEngineThread is returning 1605
=== Verbose logging stopped: 10/11/2017  8:50:49 ===

Docker (at least for windows) really really really needs to get its install / upgrade / uninstall act together. When I have issues uninstalling I use this powershell script from an admin powershell session:

$ErrorActionPreference = “SilentlyContinue”

kill -force -processname ‘Docker for Windows’, com.docker.db, vpnkit, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd

try {
./MobyLinux.ps1 -Destroy
} 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"
Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | % {Get-ItemProperty $.PSPath} | ? { $.DisplayName -eq “Docker” } | Remove-Item -Recurse -Force
Get-ChildItem HKLM:\software\classes\installer\products | % {Get-ItemProperty $.pspath} | ? { $.ProductName -eq “Docker” } | Remove-Item -Recurse -Force
Get-Item ‘HKLM:\software\Docker Inc.’ | Remove-Item -Recurse -Force
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 $.PSPath
#Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | Where-Object { $(Get-ItemPropertyValue $
) -Contains “Docker” }

Nope, that script, along with every other powershell script I’ve tried did not work for me.

I ended up running process monitor on the Docker for Windows.exe installer program figuring it was checking some dumb stupid file or registry key that isn’t obvious to anyone or anything else.

So it ended up being some key in HKCR\Installer\UpgradeCodes that I found it was reading. When I blew that away it FINALLY proceeded into thinking it was a fresh install!

If anyone has any such similar problem and after completely manually obliterating everything to do with docker on your machine and the package still refuses to install, run Process Monitor on the installer executable and filter on just the registry key reads. Find the key that it successfully reads under HKCR\Installer\UpgradeCodes and blow it away.

4 Likes

The latest docker (17.09.0-ce-win33 & win34) install hangs with no explanation whatsoever at "Removing files …"
I have tried everything possible with no success whatsoever:

  • I completely uninstalled docker.
  • I install as administrator.
  • I tried to clean the FS and the registry.
  • I tried every blog/solution/suggestion here.

This is the first version where installing docker from scratch hangs.

Saved my day (week and month …)!

1 Like