Skip to content

Instantly share code, notes, and snippets.

@efontan
Last active March 13, 2021 09:14
Show Gist options
  • Save efontan/4107910128a87c8a7a6fb322416a9d63 to your computer and use it in GitHub Desktop.
Save efontan/4107910128a87c8a7a6fb322416a9d63 to your computer and use it in GitHub Desktop.
Move WSL2 distro from C drive in Windows 10

Move WSL2 distro from C drive in Windows 10

choco install lxrunoffline
  • List installed distros:
wsl -l -v
  NAME                   STATE           VERSION
* docker-desktop         Running         2
  docker-desktop-data    Running         2
  Ubuntu                 Stopped         2
  • Make sure all distros are Stopped or run wsl --shutdown
  • Move the desired distro to another drive:
lxrunoffline move -n docker-desktop-data -d D:\wsl\docker-desktop-data

Note: you have to specify different directories for every distro to move.

(*) To install Chocolatey: https://chocolatey.org/install

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