- Backup current vhdx file
from
%LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx
toD:\ext4.vhdx
(Most important step. If you can't find correct vhdx file, you shouldn't go ahead) - Remove current distro, like wsl --unregister Ubuntu-20.04
- Reinstall distro from Microsoft Store
- Export and import
wsl --export Ubuntu-20.04 D:\wsl.tar
wsl --unregister Ubuntu-20.04
wsl --import Ubuntu-20.04 D:\Ubuntu-20.04 D:\wsl.tar
- Overwrite original vhdx file
copy D:\ext4.vhdx D:\Ubuntu-20.04\ext4.vhdx
- Set default user
ubuntu2004.exe config --default-user <username>
Change path in regedit Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{randon uuid}\BasePath
If you get Access Denied
, change User
permissions to Full controll
.