Moving vhdx of WSL2
- Your primary drive has low space
- WSL2 is consuming a lot of space
- The vhdx is a no-shrinking file
- Move the vhdx to another drive
Execute this code i got from here
wsl --shutdown wsl -l -v wsl --export <DistroName> <PathToTarArchive> wsl --unregister <DistroName> wsl --import <DistroName> <PathToDistroNewDirectory> <PathToTarArchive> wsl -l -v
Note you have to put the .tar, otherwise the access is denied at the beginning happens.
Additionally clean docker vhdx space
- This space doesn’t show in docker except in the troubleshoot page.
- Press Clean/Purge data