7

I have WSL 2 installed on my Windows 10 machine. I switched over to version 1 and upgraded from Ubuntu 18.04 to 19.04 using the do-release-upgrade command. I then tried to switch over to WSL 2, but I noticed the output of wsl -l -v is Ubuntu 18.04, not 19.04, but when running an Ubuntu prompt the output of lsb_release -a is accurately 19.04. I then tried moving the distro as named over to WSL 2 anyway, and received a

Exporting the distribution failed.
bsdtar: Write error

error. I am hoping that updating the name to the actual distro (19.04) will solve this issue. Any idea on how to do that? Probably it's in some config file for WSL?

2
  • Does that distribution works now as WSL2?
    – Biswapriyo
    Dec 4 '19 at 8:30
  • Including the exact commands used when moving the distro would help diagnose the problem.
    – M.W.
    Aug 19 at 18:24
4

If you want to rename your WSL distro, you have to:

  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 the DistributionName
  4. Change it as you want
  5. Start WSL again, you can also execute wsl.exe -l -v to check if it changes
1

Just ran into this myself. Though it's basically just cosmetic and only comes up when running WSL specific commands, I wanted to keep things from getting confusing in the future.

What I ended up using LxRunOffline to duplicate my Distro, which in the process allows you to name the duplicate, setting the duplicate as default, and then uninstalling my old Distro.

Example of what I did(ran in powershell from my user's home directory):

#List installed Distros
LxRunOffline.exe l
#Duplicate Ubuntu-18.04 to folder in my user directory and name it Ubuntu
LxRunOffline.exe d -n Ubuntu-18.04 -d ./WSL/Ubuntu -N Ubuntu
#Set new Distro as default
LxRunOffline.exe sd -n Ubuntu
#Uninstall old Distro
LxRunOffline.exe ui -n Ubuntu-18.04

PS: To be clear, the WSL listed name of your Distro is unrelated to what is really running inside the Distro. So you just have to use the current name WSL currently lists, in the WSL2 convert command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.