WSL2 & Docker Space-Saving Tricks on Windows 10/11

Опубликовано: 11 Май 2026
на канале: Vasudev Menon
602
10

In this video I'll show how to reduce or shrink WSL2 Disk Usage on Windows 11 with docker. it's applicable regardless of whether you've installed docker or not.
#gaming #nvidia #nvidiabroadcast #ai #rtx
Background noise and room echo removed through Nvidia broadcast on RTX 4070 Super

Commands Used:
if docker is being used
docker ps -a
backup volumes of container you're about to remove
docker container remove container_id

system prune

docker system prune -a
end of command docker is being used

shutdown wsl (needs admin privileges)
wsl --shutdown

Compress vdhx on the Home edition of Windows 10 and Windows 11(needs admin privileges):
diskpart
select vdisk file="C:\Users\your_username\AppData\Local\Docker\wsl\disk\docker_data.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit

Win 10/11 Pro, Enterprise (needs admin privileges)
Optimize-VHD -Path "C:\Users\your_username\AppData\Local\Docker\wsl\disk\docker_data.vhdx" -Mode Full

Links:
Nvidia Broadcast: https://www.nvidia.com/en-us/geforce/...

Timestamps:
00:00 Start
00:10 Intro
01:18 Stop all docker instances (Applicable to users of docker on Windows)
02:52 Stop WSL2 using the wsl shutdown command
05:12 Optimize-VHD command to reclaim Disk Space on Pro and later editions
05:36 Alternative way to shrink disk storage on Home edition using diskpart
06:46 Purge docker data using docker desktop app (Disk Storage reduces to 1.x GB)
07:50 Outro
08:07 End