Difference between revisions of "HOW-TO: Backup or Move WSL2 Distro"

From Tayledras
Jump to: navigation, search
Line 1: Line 1:
 +
Move WSL to another drive
  
* Install<span></span><code class="language-text">LxRunOffline</code><span></span>tool.<span></span><code class="language-text">choco install lxrunoffline</code>
+
* Install LxRunOffline tool. choco install lxrunoffline
* <code class="language-text">lxrunoffline list</code><span></span>List all the installed distros on your system. I get output like this.
+
( lxrunoffline list List all the installed distros on your system. I get output like this.
  
<pre class="language-bash"><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></pre>
+
Microsoft Windows [Version 10.0.19041.207]
* <code class="language-text">lxrunoffline move -n Ubuntu-18.04 -d G:\wsl\</code><span></span>. Move your distro to another drive. My distro name here is<span></span><code class="language-text">Ubuntu-18.04</code>. I am moving it to<span></span><code class="language-text">G drive</code><span></span>and<span></span><code class="language-text">wsl</code><span></span>folder inside it. It would take some time to finish moving.
+
(c) 2020 Microsoft Corporation. All rights reserved.
 +
D:\work>lxrunoffline list
 +
Ubuntu-18.04
 +
docker-desktop
 +
docker-desktop-data
 +
D:\work>
 +
 
 +
* lxrunoffline move -n Ubuntu-18.04 -d G:\wsl\ . Move your distro to another drive. My distro name here is Ubuntu-18.04. I am moving it to G drive and wsl 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.
 
You can use the same move command to move your distro from default location to a different location inside C Drive.

Revision as of 14:43, 18 October 2020

Move WSL to another drive

  • Install LxRunOffline tool. choco install lxrunoffline

( lxrunoffline list List all the installed distros on your system. I get output like this.

Microsoft Windows [Version 10.0.19041.207] (c) 2020 Microsoft Corporation. All rights reserved. D:\work>lxrunoffline list Ubuntu-18.04 docker-desktop docker-desktop-data D:\work>

  • lxrunoffline move -n Ubuntu-18.04 -d G:\wsl\ . Move your distro to another drive. My distro name here is Ubuntu-18.04. I am moving it to G drive and wsl 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.