Windows Subsystem for Linux (WSL) allows you to run a full Linux distribution inside Windows without the need for a virtual machine or dual boot. By default, installed distributions take the standard names (e.g., Ubuntu-24.04), but with a few extra steps, you can create an instance with a custom name, such as Ubuntu24.04-Dev1. This is especially useful for developers managing multiple environments.
Below are the step-by-step instructions:
1) Install the Ubuntu Environment on Windows (with default name)
First, open PowerShell with administrative privileges.
- Press Windows Key + R
- Type
powershelland press Ctrl + Shift + Enter (to run as Administrator) - Approve the UAC (User Account Control) prompt if it appears
Then, install Ubuntu 24.04 (or your preferred distribution) by running:
powershell
wsl --install Ubuntu-24.04
At this stage, WSL installs Ubuntu with its default registered name: Ubuntu-24.04.
2) Export the Newly Installed Ubuntu Distribution
Once installed, you need to export the distribution to a .tar file. This lets you re-import it under a custom name later.
powershell
wsl --export Ubuntu-24.04 D:\docker\Ubuntu-24.04.tar
- Replace
D:\docker\Ubuntu-24.04.tarwith the path where you want to store the exported image. - This creates a backup of your WSL distribution that can be imported anywhere.
3) Import Ubuntu with Your Desired Custom Name
Now, re-import the distribution using your preferred name and target folder.
powershell
wsl --import Ubuntu24.04-Dev1 F:\docker\installed_distribution D:\docker\Ubuntu-24.04.tar --version 2
Here’s what each argument means:
- Ubuntu24.04-Dev1 → Your custom distribution name
- F:\docker\installed_distribution → The folder where your new WSL instance will live
- D:\docker\Ubuntu-24.04.tar → The previously exported
.tarfile - –version 2 → Ensures WSL2 is used
At this point, your custom-named distribution has been created.
4) Set the Default User for Your Custom Distribution
If you had already created a user in your original Ubuntu installation, you may want to keep the same user in your newly imported instance.
Use the .exe command (as Administrator) for your custom distribution to configure the default user:
powershell
wsl.exe -d Ubuntu24.04-Dev2 --setdefaultuser YOUR_USERNAME
Replace YOUR_USERNAME with the username from your original Ubuntu environment. This ensures that every time you launch your custom distribution, it logs in with that user instead of root.
You’re done!
You now have a WSL distribution installed with a custom name. This makes it easier to organize multiple environments for development, testing, or project-specific workflows.

