Skip to main content
WSL Ubuntu Windows Move a WSL Ubuntu that eats up C-drive space to another disk, freeing the system drive while keeping all installed software and settings. The approach: package with wsl --export into a tar, redeploy with wsl --import to the new location, switch the default, then clean up the old install.
The migration temporarily stops the WSL service, so do it outside working hours. The whole process takes about 30 minutes to 2 hours depending on system size.

Before you start

Requirements

ItemMinimumRecommendedNotes
Disk spaceUbuntu size × 1.2Ubuntu size × 1.5Target disk needs enough room
RAM4GB8GB+Large systems need more memory
Windows versionWindows 10 v1903Windows 11Newer versions have better WSL support
PrivilegesStandard userAdministratorAdmin rights avoid permission issues

Backup strategy

Migration is relatively safe, but take precautions first.
Ubuntu is fully packaged and redeployed during migration. Back up important user data to the cloud or external storage, especially:
  • /home/<username>/: user home directory
  • /opt/: third-party software
  • custom config files
Allow enough time for the migration and do not cut power or shut down mid-process.

Migration steps

1

Check system state

Open PowerShell as administrator and list all WSL distros (name, state, WSL version, default marker):
wsl -l -v
Record the exact distro name (e.g. Ubuntu-22.04); later steps use it.
2

Package the Ubuntu system

Export the current Ubuntu to a portable tar (adjust the distro name and target path):
wsl --export Ubuntu-22.04 D:\ubuntu-22.04-backup.tar
ParameterExampleNotes
Ubuntu-22.04distro nameThe name confirmed in step 1
D:\ubuntu-22.04-backup.tarexport pathFull path and filename of the backup
The export shows no progress and runs continuously. Be patient and do not interrupt it or close the window. Watch the target file size to monitor progress.
3

Deploy to the new location

Create the migrated Ubuntu instance:
wsl --import Ubuntu-22.04-diskD D:\Ubuntu-22.04-diskD D:\ubuntu-22.04-backup.tar
The parameters are, in order: new instance name (your choice), the folder where its files actually live, and the export path from step 2. Use a descriptive name (e.g. Ubuntu-DataDisk) and avoid special characters and spaces. Run wsl -l -v again to confirm the new instance appears.
4

Set default and fix the user

Point the default WSL distro at the new instance:
wsl --setdefault Ubuntu-22.04-diskD
After wsl --import the default user becomes root (imported distros do not keep the original default user). Create /etc/wsl.conf inside the new instance to set the default user, then wsl --shutdown to restart and log in as your normal account:
[user]
default=<your-username>
Verify it starts:
wsl
5

Clean up the old system

Once the new environment works, remove the old Ubuntu to free the C drive:
wsl --unregister Ubuntu-22.04
This permanently deletes the old Ubuntu install. Be sure the new environment works before running it.
Use Disk Cleanup to check the C-drive gain, confirm the WSL folder is gone, and run wsl -l -v to confirm the old distro disappeared. Keep the tar as an extra backup for a while, then delete once stable:
del D:\ubuntu-22.04-backup.tar
Here is roughly what the full migration flow looks like, from confirming the source through export, deploy, and verifying the new instance:

Troubleshooting

CauseCheckFix
Not enough disk spaceCheck target free spaceFree space or switch disks
Insufficient privilegesConfirm running as adminReopen PowerShell as admin
Ubuntu not fully stoppedCheck WSL statewsl --shutdown and retry

Emergency recovery

If migration hits a serious, unrecoverable problem:
  1. Verify the original tar exists and is intact
  2. Clean the problem instance: wsl --unregister Ubuntu-22.04-diskD
  3. Redeploy with the same import command
  4. If still broken, temporarily fall back to the original instance until resolved
Recovery returns to the pre-migration state but loses any changes made during migration. Evaluate carefully before running it.