Skip to content

Instantly share code, notes, and snippets.

@deepwilson
Created July 6, 2023 21:23
Show Gist options
  • Save deepwilson/303ecb4bff9b86fe35668e84f77a67b7 to your computer and use it in GitHub Desktop.
Save deepwilson/303ecb4bff9b86fe35668e84f77a67b7 to your computer and use it in GitHub Desktop.

If you want to move WSL2 Linux distro(Ubuntu) from C: drive D: below are the steps.

Export Ubuntu

mkdir D:\backup wsl --export Ubuntu D:\backup\ubuntu.tar Unregister the same distribution to remove it from the C: drive:

wsl --unregister Ubuntu Import Ubuntu

mkdir D:\wsl wsl --import Ubuntu D:\wsl\ D:\backup\ubuntu.tar By default Ubuntu will use root as the default user, to switch back to previous user

Go to the Ubuntu App Folder run command to set default user

cd %userprofile%\AppData\Local\Microsoft\WindowsApps ubuntu config --default-user

wsl --list -v

wsl --list wsl --shutdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment