Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to move wsl storage

Example for moving to D:WSLUbuntu

Step 1. Install Ubuntu in the store. 
Launch it to initialize the default instance.
Create the user used in Ubuntu as prompted.


Step 2. Export the instance and import into the target directory.

cd D:
mkdir WSL
cd WSL
wsl --export Ubuntu ubuntu.tar
wsl --unregister Ubuntu
mkdir Ubuntu
wsl --import Ubuntu Ubuntu ubuntu.tar

Step 3. Set the default user for the moved Ubuntu.
Find the directory in registry 
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionLxss 
which DistributionName is “Ubuntu”. Set its DefaultUid to decimal 1000 (or hex 3e8).

Step 4. Try wsl

wsl -d Ubuntu
Source by blog.iany.me #
 
PREVIOUS NEXT
Tagged: #move #wsl #storage
ADD COMMENT
Topic
Name
4+6 =