WSL: Conversion in progress... stuck?

Environment

Microsoft Windows [Version 10.0.19041.264] Converting from WSL 1 to WSL 2

Steps to reproduce

wsl --set-version Ubuntu 2, --set-default-version 2

Expected behavior

Conversion says its should take a few minutes

Actual behavior

Conversion has now been running for nearly an hour and no sign of activity.

I have checked in a seperate window and it does report that it’s still converting.

C:\WINDOWS\system32>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu                 Converting      1
  docker-desktop-data    Running         2
  docker-desktop         Running         2

Is there any way to check on the actual progress, could I have something in my environment which is either taking a long time or has hung?

I obviously don’t want to kill the upgrade as that could cause me to loose all of the work I have in WSL.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 27
  • Comments: 32

Most upvoted comments

WE NEED A PROGRESS BAR!

The title of this issue says it all: Conversion in progress… stuck? Please consider reopening this issue with the intent of impementing some kind of progress bar.

Slow progress may be caused by insufficient ram #4669 or Antivirus/Window Defender or anything else. But that does not imho make this issue a dup.

Wasn’t doing too much disk access but was using 32GB of RAM (all of it).

Its just finished so did it did work, but it took 2 1/2 hours.

It takes me over 3 hour, and it still has not finished yet

are you sure that it takes 30 minutes or so? Cuz in my case, it never got completed

Closing as duplicate

Use task manager and see if vmmem is doing any disk activity (the ‘Disk’ column of the ‘Processes’ tab). Unless it has totally flatlined, give it as much time as you can stand. Have a look at memory as well, you might be hitting #4669.

After about half an hour of Vmmem maxing out the CPU and 8 GB of RAM, memory usage eventually dropped back down to 1 GB.

I almost gave up, seeing as there was apparently no CPU activity and no output on the console - but after 10-15 minutes of inactivity, the command finally returned with “conversion complete”.

Yeah, there ought to be a progress indicator of some sort for an operation this long.

I just finished converting ubuntu 20.04 to wsl2. In my case, I waited about 2 hour for my rather new 20.04 distro to be converted until I decided there must be something wrong. I canceled converting and found all the wsl comand stopped working in powershell. I then restarted my PC and tried again. This time it took less than 10 min.

It had sucked almost one hour and when I was taking a screenshot to post here, it suddenly finished! So I posted the result here to stimulate more patience.

However. The official prompt for the conversion should be warning users that it will takes dozens of minutes rather than some minutes!

I figured a way to heuristically measure the progress of this: you can run a du -sh in your Linux root to get its size, and note the size of your C: drive before running the set-version. Then when you start the conversion which basically creates a new FS copying the entire Linux structure. By the amount of extra storage being consumed in C: drive compared to initial you can guess the progress.

For example, if my Linux system had an original size of 8G, and my C: drive had 32G left in the beginning, and during the process 27G is left, the progress so far is (32-27)/8 = 62.5%

Even better, you can watch the VHDX file being built in this location (though I’m not sure if it’s exactly the same hash for everyone): C:\Users\{YOUR USER}\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

Separately, I came across this issue initially because of the hang but found there were 2 things happening which were going to cause issues with it ever finishing:

  1. I’d downgraded from WSL2 to WSL1 at one point, but there was a lingering VHDX file in that location from the downgrade which had to be removed, and
  2. I ran out of disk partway through the operations, and despite quickly freeing up space, the VHDX completely stopped growing despite there being no indicator on the command line that there was an error.

Much more messaging for this operation would be helpful, both in progress tracking and in communicating errors. It’s so opaque as it stands today.

it consistently gets stuck, I let it run for 36 hours multiple times:

  • at the start, there’s some CPU/Disk activity for about 30 mins
    • VmemmWSL stacks up to 800MB of RAM
    • I can see bsdtar working
  • Past that point, it just gets stuck with absolutely no CPU/disk activity, and can remain in this state forever
  • I’ve tried disabling Windows Defender real time protection, but it doesn’t help.

I’ve also tried exporting / reimporting the distribution, while the export works well, the import gets stuck:

wsl --export <distro> wsl.tar
wsl --import <distro> C:\Users\me\wsl\<distro> .\wsl.tar

It is faster to install a GNU/Linux distribution in WSL2 than converting from WSL1 (ext4 >>>> NTFS).

I had wsl console (from windows/system32) open in the background (didn’t notice) when I started the update in PowerShell. It was running good 30 minutes when I noticed that the wsl console was displaying a message that it’s terminated. But wsl didn’t close. It kept consuming 20% of the CPU. Disk usage was on 0. I couldn’t kill the wsl process any way I tried so I just restarted my laptop and updated in 5 minutes (or less idk).

Depending on how large your root file system was, it can take a decent amount of time. it took me about 30 minutes to convert from WSL 1 => WSL 2.

image