Created
December 11, 2021 19:16
-
-
Save aronreisx/2de3d04e35003e2a167c28525013ff58 to your computer and use it in GitHub Desktop.
How to rename WSL Distro on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To rename WSL Distros on Windows follow the steps: | |
1. Stop all instances of WSL | |
On PowerShell run the command: wsl --shutdown | |
2. Open Registry Editor and go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss | |
Each subfolder on Lxss represents a distro | |
3. Locate and rename the distro you want | |
Inside each distro folder you have the DistributionName, change it and click ok | |
4. Restart WSL service | |
Open PowerShell as Admin and run the command: Get-Service LxssManager | Restart-Service | |
All setted up. Run wsl -l to see the changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great - just what I needed, but did'nt find until now :-)
Just updated Ubuntu from 20.04 to 24.04.1 and got annoyed
BUT it's no longer correct - the correct steps (as of today 4/9-2024) for me (on Win10) is (changes start at step 4):
Stop all instances of WSL
On PowerShell run the command: wsl --shutdown
Open Registry Editor and go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
Each subfolder on Lxss represents a distro
Locate and rename the distro you want
Inside each distro folder you have the DistributionName, change it and click ok
Go to Windows Terminal -> Settings ->[the Ubuntu distribution, EG 'Ubuntu-20.04'] -> Command line
Change to reflect the new name
EG 'wsl.exe -d Ubuntu-20.04' -> 'wsl.exe -d Ubuntu'
Rename all shortcuts (if you have these - I do in Total Commander) to match the new path
EG \\wsl$\Ubuntu-20.04\home\<me>\ -> \\wsl$\Ubuntu\home\<me>\
Launch the distribution from Windows Terminal
As a side effect this (re-)starts the WSL service