Cannot uninstall Docker for Windows

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

This was a really helpful answer.
Downloaded Process Monitor, filtered by Docker and looked for the UpgradeCodes key (this appears after you click continue)

Docker really does need to get its installer act together.

I am having the same problem - I just cannot get Docker to uninstall or reinstall, or anything.

It either hangs, or stubbornly maintains that the original version is installed.

Perhaps docker could add a “repair” button to their installer, which just reinstalls everything from scratch? It’s quite clear that Docker can get into a weird state that requires repairing.

Am running Docker Windows 17.09.0-ce-win33.

After 2 days of frustration, finally got Docker to work:

1.Installed the next experimental version of Docker (Docker Edge).
2.Installing the new experimental version fixed up issues with the previous stable version.
3.Have not tried to uninstall, but I think this might work now.

I am lucky that this worked (I had everything prepared to reinstall Windows from scratch just to get Docker working, this would have happened 10 minutes later).

The same thing here.

I downloaded the latest Docker (17), run, said “Yes” to “would you like to replace the existing”.
It opens to me MSI dialog with broken tmp7130.msi.

The mentioned above PS-script is broken. It removes something but fails at removing Installation info (what is PSPath?)

After I removed manually everything in Windows registry related to Docker the installer still suggests to replace but after choosing “Yes” it shows “Cancelled”

It’s simply terrible.
Isn’t it so hard to create a working installer for Windows after all these years? Hilarious.

1 Like

Hi all!

I just wrote up some uninstall/cleanup instructions for Docker on Windows 10 and Windows Server 2016. Here’s the PR for the update to our docs: https://github.com/MicrosoftDocs/Virtualization-Documentation/pull/684

Here’s a preview link for the changes corresponding to this PR as well.

It would be a great help if folks from this thread could validate/provide feedback on the clarity and effectiveness of these instructions.

Thanks,
–Kallie B.
(Windows Core Networking)

Just had the same issue on a fresh Windows 10 installation, and I was able to remove D4W by running CCleaner registry cleaner :S

1 Like

Same problem. I can’t upgrade (The requested operation cannot be performed on a file with a user-mapped section open.) so I tried to uninstall (hangs forever) then reinstall (docker command only works with admin).

Confirm that running CCleaner allows uninstall to succeed.

I couldn’t uninstall or perform an upgrade from 2.0.0.3 to 2.1.0.0. Running the PowerShell script here didn’t immediately fix the problem: https://success.docker.com/article/how-to-completely-remove-docker-in-windows-10.

However following that up with using the registry cleaner in CCleaner (I run this periodically anyways) allowed me to install the new version no problem! Thanks @edgarknapp!!

Same here… cannot uninstall as it hangs forever.
The stranger part is that the first time it seemed to have worked, but docker is still there and now if I try to uninstall the window saying “Uninstalling…” appears but nothing happens.
Any ideas on how to actually uninstall docker desktop?

Version: 2.1.0.4 (39773)
Channel: stable
Sha1: dd741346166b668b326e9e9f5f5fed6cb0be47cf
Started on: 2019-10-30 13:34:57.563
Resources: C:\Program Files\Docker\Docker\Resources
OS: Windows 10 Pro
Edition: Professional
Id: 1809
Build: 17763
BuildLabName: 17763.1.amd64fre.rs5_release.180914-1434
File: C:\Users\asm\AppData\Local\Docker\install-log.txt
CommandLine: "C:\Program Files\Docker\Docker\InstallerCli.exe" -k -u
...
[13:36:03.326][HyperV            ][Info   ] Exporting function 'Get-NetUDPSetting'.
[13:36:03.326][HyperV            ][Info   ] Exporting function 'Set-NetUDPSetting'.
[13:36:03.357][HyperV            ][Info   ] Exporting function 'Get-NetIPConfiguration'.
[13:36:03.357][HyperV            ][Info   ] Exporting alias 'gip'.
[13:36:03.388][HyperV            ][Info   ] Exporting function 'Test-NetConnection'.
[13:36:03.388][HyperV            ][Info   ] Exporting alias 'TNC'.
[13:36:03.673][HyperV            ][Info   ] VM DockerDesktopVM is stopped
[13:36:03.689][HyperV            ][Info   ] Destroying Switch DockerNAT...
[13:36:05.971][HyperV            ][Info   ] Removing VM DockerDesktopVM...
[13:36:06.033][HyperV            ][Info   ] Delete VHD C:\ProgramData\DockerDesktop\vm-data\DockerDesktop.vhdx
[13:36:06.040][HyperV            ][Debug  ] [destroy] took 00:00:05.1180475 to run
[13:36:06.040][Firewall          ][Info   ] Closing ports...
[13:36:06.040][Firewall          ][Info   ] Removing all existing rules...
[13:36:06.071][Firewall          ][Info   ] All existing rules are removed.
[13:36:06.071][Firewall          ][Info   ] Ports are closed
[13:36:06.071][HyperVGuids       ][Info   ] Removing GUIDs...
[13:36:06.087][HyperVGuids       ][Info   ] GUIDs removed
[13:36:06.087][Linux             ][Info   ] Setting container engine status to Destroyed
[13:36:06.087][PowerShell        ][Info   ] Run script with parameters: -RemoveNetworks True
[13:36:06.573][Installer         ][Info   ] Deleting file C:\Users\asm\AppData\Roaming\Docker\settings.json
[13:36:06.573][Installer         ][Info   ] Deleting file C:\Users\asm\.docker\daemon.json
[13:36:06.573][Installer         ][Info   ] Deleting file C:\Users\asm\AppData\Roaming\Docker\last-start-linux-daemon.json
[13:36:06.573][Installer         ][Info   ] File C:\Users\asm\AppData\Roaming\Docker\last-start-windows-daemon.json does not exist
[13:36:06.573][Installer         ][Info   ] Directory  does not exist
[13:36:06.588][Installer         ][Info   ] Uninstall completed successfully

Your solution worked perfectly for me. Thank you so much.

Can you have a look at my problem?

Same on my computer… how to actually uninstall docker desktop ???
I uninstalled (docker said it uninstallation successful but still installed and also everything in the program folder)
Same as : smeualex … when i “uninstall as it hangs forever.
The stranger part is that the first time it seemed to have worked, but docker is still there and now if I try to uninstall the window saying “Uninstalling…” appears but nothing happens.
Any ideas on how to actually uninstall docker desktop?”

1 Like

Exact same issue, need help.

I just encountered this issue on Windows 10 Pro. I started the uninstaller yesterday and left it overnight before I left work. When I got back this morning it is still stuck like this

What do I do? Cancel this?

I have a different location for my VM images D:\ProgramData\docker\DockerDesktop than the default, could that have messed it up? Seems to have deleted whatever was in that folder though.