Distro management

Moving a distro to another location

I prefer to have my WSL distro on a separate drive to keep my system drive small. If you like to do the same, you can move your distro like this:

  1. Create the target directory

    For example, I created G:\WSL\Ubuntu-22.04 as target

  2. Shutdown WSL

    
    wsl --shutdown
  3. Move the distro like this:

    
    wsl --manage <DISTRO> --move <TARGET>

    If you do this directly after the installation of your WSL distro, it will only take a few seconds. After this you will find a file named ext4.vhdx in your target directory.

    You can instantly start WSL again and continue your work, a reboot is not necessary.

List installed distros

You can list the installed versions of WSL distros with:


wsl --list -v

Set default distro

And you can use this command to set your standard distro (using the distro name from the list you got with the previous command):


wsl --set-default <DISTRO>