WSL: wsl --import hangs

Version

10.0.22000.856

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.57.1

Distro Version

N/A

Other Software

No response

Repro Steps

Run wsl --import on a large tarball. (Mine was ~25G)

Expected Behavior

Import completes successfully.

Actual Behavior

wsl hangs indefinitely.

I monitored the disk usage and the size of the VM disk image. After a while, the disk usage drops to ~0 and the disk image size stops increasing. I ran import several times, and the final disk image size varied between 4G ~ 19G.

Diagnostic Logs

No response

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 8
  • Comments: 63 (1 by maintainers)

Most upvoted comments

So I found this issue, I am having it as well on Windows 11 2H2 fully updated. My solution? Reboot the PC and open NO apps you do not need (browser is fine). Navigate in file explorer to where you are SAVING the imported instance. Start the import process you should see the vhdx form in the folder you navigated to. If you have access to the old machine, you will want to look at the vhdx file and get the size and keep that as a rough target, but you are going to patiently watch the task manager and that file grow, if you see disk usage stop or the file stop growing for more than 15 seconds restart the import and repeat this until it works. I had a 12.5gb tarball, took me about 10 tries and it finally imported and is working! Hope this helps until a fix is applied.

Has this been fixed? not sure if it should be closed.

I’m having the same issue. I’m trying to move the install location to a different disk.

Same, absolute deal-breaker. Also docker stopped working. Will try to get an older WSL version.

Whenever I ctrl+c and restart it gets stuck at a different point (as to be told from the vhdx size).

/edit: works when I uninstall the WSL “Preview” with the new tux icon from the MS store

Versione WSL: 0.70.0.0
Versione kernel: 5.15.68.1
Versione WSLg: 1.0.45
Versione MSRDC: 1.2.3575
Versione Direct3D: 1.606.4
Versione DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
versione Windows: 10.0.22621.674

So I have the very same issue and this post helped me solve the problem : worth to mention though I also had to disable AV real time protection.

I see the same symptoms. wsl.exe --import hangs indefinitely. It seems to be unpacking the disk image and the unpack just stops at some random point and never makes further progress.

WslLogs-2022-10-03_11-04-33.zip

@owenschupp this problem has been dormant for awhile, can you please find someone to assign to? I will also email Insider Support per this instruction

2024-04-06

WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2861

Seems that everyone at Microsoft is paid so well that nobody has the need to check into this issue. Maintainers? Hello?

My work heavily relies on WSL templates, and I can’t import a tiny 270 MB Debian tarball.

Uninstalling WSL preview did the trick for me.

I can also confirm that my ~26GB tar finally imported successfully after uninstalling WSL “Preview”

I just did wsl --update afterwards to re-install the “Preview” updates

Yesterday we also had the problem here with a tarball approx. 180 GB in size. The high memory consumption of “Vmmem” was noticeable. So I assigned more RAM and swap in the .wslconfig and then it worked. The memory consumption of Vmmmem then increased to >25GB during the import.

Here is my .wslconfig:

[wsl2]
# Limits VM memory to use no more than x, this can be set as whole numbers using GB or MB.
memory=64GB

# Sets amount of swap storage space to x, default is 25% of available RAM
swap=64GB

# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
swapfile=D:\\wsl_swap.vhdx

Maybe it will help someone else.

By the way, the tip about importing from another drive didn’t work for us.

Tweet from @craigloewen-msft regarding this issue:

Can you try build 1.0.0 and see if it fixes you? There was a potential fix for this there.

I fixed the issue on my side by using the “wsl --update” command: the “WSL version” reported in the output of the “wsl --version” command increased from “0.70.4” to “1.0.0.0” after the update and then I imported a 56GB tar at first attempt (whereas the import had always failed with the previous version). HIH!

Idk, I was dealing with this same error and after update to that version it worked with a file of ~60GB

Windows11 preview beta channel latest I just uninstall the WSL preview and then wsl --set-version/wsl --import work fine(the ext4.vhdx size increase normally so far)

I have the same problem with my 110 GB tar that I exported with a very old WSL version (that had a version number like 10.0.XX). Tried many times to import (20+), but the import got stuck on every try at a random size of the vhdx file (most of the time something between 0.5 GB and 15 GB). For me there was no other option than installing fresh Ubuntu and manually copy my files from the tar to the newly installed distribution.

My current WSL versions:

WSL-Version: 0.70.4.0
Kernelversion: 5.15.68.1
WSLg-Version: 1.0.45
MSRDC-Version: 1.2.3575
Direct3D-Version: 1.606.4
DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows Version: 10.0.22000.1098

@BobbyWibowo what updates? Am I missing out on something? 😉

I’m currently having this problem on 2 machines.

About to test on a third. Import invariably hangs, albeit at different points in the process.

Update: Tested on the third device - that worked, but it’s a much smaller file than the others.

I looked into this more and found all the mentions of symlinks - but that’s not the issue I’m having. All three of the images I tested have the same symlinks. They are ~175GB, ~50GB, and ~3GB.

Only the smallest worked.

Update 2: I got the ~50GB installation to install! I performed a clean boot first, then tried to install. First attempt didn’t work. I used wsl --shutdown twice (when I looked in the Resource Monitor, it was still running after the first). The next import attempt was successful. It stuttered several times, but it worked.

I don’t intend to try the largest one again.

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you’re still experiencing this issue please re-open it.

Thank you!