WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Allow WSL distros to change their WSL name

Open sirredbeard opened this issue 6 years ago • 26 comments

We rebranded WLinux to Pengwin.

We maintained the WLinux name in the WSL API 1 in order to avoid breakage 2.

However this means Pengwin still appears as \WSL$\WLinux in Explorer.

It also means Pengwin appears as WLinux in the new Terminal application.

We could issue a new package of Pengwin in the Store with the new name in the API, offering it for free to everyone who has bought the old Pengwin, but it would mean a lot of links to the old package would break and would cause user confusion.

If down the line it becomes possible to rename WSL distros or identify them with a specific UUID and string that can change, it would be much appreciated.

Thank you.

sirredbeard avatar Jun 28 '19 00:06 sirredbeard

I second this with my point being that it would be cool for users to change the distro names to something more console friendly. Having to type wsl -d Ubuntu-18.04 when I want to switch quickly is annoying. Maybe smething like wsl --rename-distribution Ubuntu-18.04 ubuntu.

rwenz3l avatar Jun 03 '20 09:06 rwenz3l

[DISCLAIMER: 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

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

I put this here for those who cannot wait any longer and have to flinch every time they see distro Ubuntu-18.04 or WLinux listed when they are in fact running Ubuntu 20.04 or Pengwin.

gcalis avatar Jun 05 '20 13:06 gcalis

@gcalis It helps to rename distro in wsl list, but doesn't change installed app, so application won't start from the Start menu after registry change.

begetan avatar Jun 11 '20 15:06 begetan

@gcalis It helps to rename distro in wsl list, but doesn't change installed app, so application won't start from the Start menu after registry change.

is there any way to fix this issue?

ouwyukha avatar Jun 16 '20 06:06 ouwyukha

I can imagine instead of replacing the actual value, you could create a new registry entry with the desired name? That leaves you with 2 entries per distro, but may work for both entrypoints then (not tested!). This is a hack either way.

rwenz3l avatar Jun 16 '20 09:06 rwenz3l

This would be really nice, as people who update their distros with do-release-upgrade-route get an updated distro that is listed by their previous version in wsl -l and have their start menu executables by their old name which can get pretty confusing.

4lph4-Ph4un avatar Jun 19 '20 14:06 4lph4-Ph4un

Arse. And I thought this would be an easy fix.

oising avatar Aug 10 '20 21:08 oising

Hey, I just had the same issue and I found the solution

Step 1: Enter settings by pressing "Ctrl + ," Step 2: Modify the name from distro's profile

{
    "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
    "hidden": false,
    "name": "Ubuntu (RENAME HERE)",
    "source": "Windows.Terminal.Wsl",
    "useAcrylic": true, 
    "acrylicOpacity": 0.9,
    "fontFace": "CodeNewRoman Nerd Font"
}

Step 3: Save the change Step 4: Restart Terminal and see the result

🚀🚀🚀

nguyentamgm avatar Nov 30 '20 14:11 nguyentamgm

@nguyentamgm That doesn't solve the problem. What you've done is changing the tab name within Windows Terminal. But the issue here is that the listing under wsl -l is still unchanged.

watermarkhu avatar Nov 30 '20 14:11 watermarkhu

I have had success renaming a WSL2 distribution by exporting the image as a .tar file to another location, then reimporting it with the new name. This sets up everything appropriately from what I can tell, except the Start Menu short-cuts to open the distro terminal. If anyone finds out how to get those sorted, I'd love to know.

However, no problems remoting into them with VS Code + extension, or via Windows Terminal(s), etc.

ghost avatar Jan 08 '21 14:01 ghost

Any update on when this will be possible?

adambirds avatar Jul 20 '22 00:07 adambirds

I have had success renaming a WSL2 distribution by exporting the image as a .tar file to another location, then reimporting it with the new name. This sets up everything appropriately from what I can tell, except the Start Menu short-cuts to open the distro terminal.

Has anyone tried this wsl --export/--import trick on a distro from the MS store? If so, were app updates broken afterwards?

Acumane avatar Aug 11 '22 00:08 Acumane

Would love to see this too. All my distros now have ancient names that no longer reflect what's running in them.

garyo avatar Dec 20 '22 19:12 garyo

Is there any update or a schedule on this feature?

wuxu92 avatar Jan 24 '23 14:01 wuxu92

I would be delighted to observe this as well. All the operating systems I use now have old-fashioned labels that don't accurately reflect what is running on them.

pashagolub avatar Jan 27 '23 13:01 pashagolub

I'd like this feature please, we are running scripts to set WSL up for developers and it would be important to set the name of the distro as seen in the wsl -l list so it reflects what it is accurately. This will greatly help us with troubleshooting too.

As an example, at the moment the distro just gets imported as "Ubuntu" but it might be 18.04 or 20.04 or 22.04

mendhak avatar Feb 02 '23 17:02 mendhak

I think this should be an easy Quality of Life improvement.

Can this issue be more prioritized because it is a "quick win" ? (if it is)

thenger avatar Apr 05 '23 12:04 thenger

I would love to have this feature rather than having to do one of the workarounds

mwoodpatrick avatar Apr 08 '23 10:04 mwoodpatrick

Hm, having custom name for each WSL instance is required if we want multiple instances from the same distro. Currently, this is the workaround for both issues: https://endjin.com/blog/2021/11/setting-up-multiple-wsl-distribution-instances

xuanswe avatar Aug 17 '23 13:08 xuanswe

upping on the wsl --rename-distribution proposal. a real Quick-Win: it would not cost much to implement, but would definitely make our developers' life easier ;)

aquette avatar Dec 06 '23 20:12 aquette

Any update on this?

Jplus2 avatar Jan 21 '24 07:01 Jplus2

bump

jasonkenneth avatar Mar 06 '24 14:03 jasonkenneth

4 years... Typical Microsoft response time, right?

ztarem avatar Oct 12 '24 07:10 ztarem

Would be great to see this happen !

HarveyJMartin avatar Oct 28 '24 14:10 HarveyJMartin

So it's 2025 now...

KiNG-GH avatar Mar 23 '25 14:03 KiNG-GH

+1 on renaming feature

surfaceowl avatar May 13 '25 17:05 surfaceowl