How to completelly remove docker and all leftovers?

I installed docker for windows. The installer did not allowed me to chose the installation drive (that is ridiculous) and it grabbed 13 GB of space in my C:, leaving only 10 GB free, that is not enough to windows run properly.

I uninstalled docker, but it removed only 3 GB of data.

Where are the other 10 GB and how to remove it?
(no container was installed)

As Docker for Windows uses a technology called Hyper-V to create virtual machines, and these virtual machines take up disk space. When you installed Docker for Windows, it likely created a virtual hard drive (VHD) file for the default virtual machine, which can take up a significant amount of space. You can check the location of this VHD file by going to Control Panel > Programs and Features > Docker for Windows > Uninstall.
You can remove the remaining space by deleting this file.

Also, you can also use the command prompt and type docker system prune to remove all stopped containers, all networks not used by at least one container, all dangling images, and all build cache

1 Like

Thank you for the answer, Ajeet!

Yes, seems a VHD was created, as there is an icon called “Linux” as a kind of drive.

I uninstalled docker at:
Control Panel > Programs and Features > Docker for Windows > Uninstall
but the VHD still is there.

If I right-click the “Linux” drive and choose “properties”, then pops a message saying “properties are not available”.

That “Linux” is not in the partion’s list, but going to drive C: > PROPERTIES > HARDWARE there is the Microsoft virtual disk.

I entered in its properties and “removed” it, but after restart the computer it is back, and the 10 GB space was not released.

I searched for large files at C: (above 4 GB), setting the system to show hidden files, but could not find any that can be such VHD.

:worried:

The vhdx files for the Docker Desktop WSL distributions are located in %USERPROFILE%\AppData\Local\Docker\wsl\.

Hi Metin,

The directory is empty.
I searched all the C: for *.vhdx files, and could not find anything related to docker.

:frowning_face:

Hi I encountered this issue as well. Is there a fix to this? As sukhoi47 said, directory for %USERPROFILE%\AppData\Local\Docker\wsl\ is empty

Any updates?

I have the same issue.

I can’t find any directory where Docker exists.

I want to get rid of Linux icon in file explorer as it has nothing in it.

I had success by using the docker installer exe. One can be found in program files.
It automatically removed the virtual machines.
VERY IMPORTANT:
copy the installer out of programe files before running.

run arguments found here on docker help page

Not sure if will work if you already did the control panel install method.

This worked for me, there was a 13.4 GB vhdx file under \AppData\Local\Docker\wsl\disk

Thank you so much! You saved me so much time :)))

To remove the Linux OS’s from your Network in Windows try the following.
Open Powershell type wslconfig /l (this will list the versions of Linux you had/have installed)
Mine looked like this:
CentOS8 (Default)
Ubuntu-22.04
Ubuntu
I didn’t have CentOS8 installed anymore and Docker Desktop kept erroring when it booted.
To remove CentOS8 I used
wslconfig /u CentOS8 ( replace CentOS8 with the OS you want to remove from your list)

Hope this helps
/r
Procyan