yjmantilla.github.io

View on GitHub

Moving vhdx of WSL2

The problem

Causes

Solution

How

Execute this code i got from here

wsl --shutdown
wsl -l -v
wsl --export <DistroName> <PathToTarArchive>
wsl --unregister <DistroName>
wsl --import <DistroName> <PathToDistroNewDirectory> <PathToTarArchive>
wsl -l -v

Example

example

Note you have to put the .tar, otherwise the access is denied at the beginning happens.

Additionally clean docker vhdx space

purge docker