HOW-TO: Backup or Move WSL2 Distro
- Install
LxRunOffline
tool.choco install lxrunoffline
lxrunoffline list
List all the installed distros on your system. I get output like this.
<code class="language-bash">Microsoft Windows <span class="token punctuation">[</span>Version <span class="token number">10.0</span>.19041.207<span class="token punctuation">]</span><span class="token punctuation">(</span>c<span class="token punctuation">)</span> <span class="token number">2020</span> Microsoft Corporation. All rights reserved.D:<span class="token punctuation">\</span>work<span class="token operator">></span>lxrunoffline listUbuntu-18.04docker-desktopdocker-desktop-dataD:<span class="token punctuation">\</span>work<span class="token operator">></span></code>
lxrunoffline move -n Ubuntu-18.04 -d G:\wsl\
. Move your distro to another drive. My distro name here isUbuntu-18.04
. I am moving it toG drive
andwsl
folder inside it. It would take some time to finish moving.
You can use the same move command to move your distro from default location to a different location inside C Drive.