HOW-TO: Rename WSL Distro Name

From Tayledras
Jump to: navigation, search
Listing all WSL instances and versions

Related

Overview

As of WSL2 in Windows 10 Build 2004, there is no CLI command from PowerShell to rename the Linux Distribution Name. Here's how to do it easily using Registry Editor.

Do not mess with your registry if you don't know what you're doing, it might break your Windows installation! Treat the Registry Editor like sudo: "With great power, comes great responsibility" WARNING:

Do not mess with your registry if you don't know what you're doing, it might break your Windows installation! Treat the Registry Editor like sudo: "With great power, comes great responsibility"

Having said that, this is an easy (and as far as I can see harmless) hack using the Registry editor:

I renamed the distro by changing the following key:

  HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss{xxxxxxxxx-YOUR-GUID-HERE-xxxxxxxx}\DistributionName

Step-by-Step

  1. Stop all instances of WSL
  2. Open Registry Editor and go toHKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss
  3. Find the distro you want to rename, look for het keyDistributionName
  4. Change the keyDistributionNameto the desired value
  5. Start WSL again and browse to\\wsl$to find your renamed distro, or executewsl.exe -v -l