Move WSL to another location
Running low on C drive space? Follow this step-by-step guide to safely move your WSL (Windows Subsystem for Linux) distribution and Docker data to a new drive location using the wsl --export and wsl --import commands.
This article is over a year old but was reviewed on July 30, 2026 — the content is still accurate.
This article is part of the WSL2 - Install, move and use it series:

https://dev.to/mefaba/installing-wsl-on-another-drive-in-windows-5c4a
This article shows how to move a WSL2 distribution off the C: drive to free up space, using wsl --shutdown, wsl --export to a .tar file, wsl --unregister to remove the original, and wsl --import to recreate it on another drive — the same export/unregister/import pattern also works to relocate the Docker Desktop WSL partition.
By default, the Linux distribution is installed on your C: drive. If, like me, you have a D: drive with almost nothing on it, it can be really interesting to move Linux to that second drive.
Once moved, nothing else changes: your distribution keeps working exactly as before, including opening your Linux folders in Windows Explorer.
To do this:
- Run
wsl --list --verbosefrom a PowerShell console; you will get the name of your distribution (Ubuntuin my case), - From an administrator PowerShell console,
- Run
wsl --shutdownto shutdown WSL, - On your second drive, create a temporary folder like
d:\wsl, - Run
wsl --export Ubuntu d:\wsl\ubuntu.tar, - When finished, run
wsl --unregister Ubuntuand then, - Run
wsl --import Ubuntu d:\wsl\ubuntu d:\wsl\ubuntu.tar --version 2 - Run
del d:\wsl\ubuntu.tar
- Run
You will need to do this for every distribution you have installed that you want to move.
Information
If you have Docker, you can do the same and move the Docker partition to your second disk.
Once done, restart your computer to finalize the move.





