Move wsl distribution to other drive

Posted by huylvt on March 5, 2021

I have a small 128GB SSD. I run out of space when I install Docker Desktop related dev tools. So I wanted to find a way to install/move my existing distro to different location than C drive.

PS C:\> wsl --export Ubuntu D:\backup\Ubuntu.tar
PS C:\> wsl --unregister Ubuntu
Unregistering...
PS C:\> wsl --import Ubuntu D:\wsl D:\backup\Ubuntu.tar
PS C:\> cd C:\Users\Admin\AppData\Local\Microsoft\WindowsApps\
PS C:\Users\Admin\AppData\Local\Microsoft\WindowsApps> .\ubuntu.exe config --default-user <userName> // Set user default.