For a long time I have had an issue where running docker desktop on a windows machine limits the disk size.
For example, the .vhdx file is located on my C: drive and on that drive there is plenty of space, but docker desktop shows me:
Disk: 528.61GB used (limit 1006.85GB)
Even though there is space, it limits me to 1TB. I looked around here for similar issues and some people have offered that in settings > resources you can change the slider to allocated more space, but for me there is no slider there, I can only browse the directory the disk file is in.
I also tried myself to change the .vhdx file size with diskpart but unfortunatly I am not a pro at that and last time I bricked the file and had to use a backup that I made for that case.
Thank you for your response.
I am currently in the process of making backups so I cannot try yet, but I myself found on google another command where they used “Optimize-VHD”, but in my case the Resize-VHD should work fine?
Another thing I found was on here How to manage WSL disk space | Microsoft Learn where they used --manage to expand so if I also run wsl --manage docker-desktop --resize 2T then that should also do it?
Funny thing was when I ran wsl.exe --system -d docker-desktop df -h /mnt/wslg/distro then it showed me that there is a filesystem /dev/sdc with size 1007G and used 57M, this seems to be the same 1006.85 but strange how it was using only 57M.
I just want to be sure before I run because if I brick the disk then I have to go back from the backup.
It does not seem to provide any output, it just started a new line. I must also mention that with wsl --list I only have docker-desktop so I am using that.
but that disk is the disk of the docker-desktop WSL2 distribution. It is true that there is no “docker-desktop-data” distribution, but the disk still exists and mounted as data disk. The name of the data disk could be found this way:
lsblk | grep /mnt/docker-desktop-disk
You can also get the disk path in a container as the hosts files are bind mounted from the hostand the df command will show the real disk path
docker run --rm -it --privileged --pid host ubuntu df -h
That data disk can be found in the following folder on the host:
phppr@TA-LT C:\Users\phppr\AppData\Local\Docker\wsl\disk>dir
Volume in drive C has no label.
Volume Serial Number is B66D-90E7
Directory of C:\Users\phppr\AppData\Local\Docker\wsl\disk
2024-12-14 19:33 <DIR> .
2025-06-19 22:15 <DIR> ..
2025-06-22 21:23 14,873,001,984 docker_data.vhdx
1 File(s) 14,873,001,984 bytes
2 Dir(s) 93,877,485,568 bytes free
The “main” folder next to “disk” contains the OS disk as ext4.vhdx but the one quoted bove is the data disk. That is the one that can be moved to a new location using the GUI (Settings » Resources » Advanced » Disk image location)