WSL icon indicating copy to clipboard operation
WSL copied to clipboard

wsl --import Unspecified Error / The specified network name is no longer available.

Open kristof-mattei opened this issue 6 years ago • 19 comments

  • Your Windows build number: Microsoft Windows [Version 10.0.19041.21]

  • What you're doing and what's happening: Exported Ubuntu from C Drive due to size issues. I now have a .tar sitting on D:\Ubuntu.tar Trying to import the file yields Unspecified Error or The specified network name is no longer available. Command executed: wsl --import Ubuntu-18.04 d:\WSL\Ubuntu-18.04\ d:\Ubuntu.tar

  • What's wrong / what should be happening instead: This shouldn't happen, the Distro should import.

  • For WSL launch issues, please [collect detailed logs] logs.zip Logs attached!

kristof-mattei avatar Jan 21 '20 20:01 kristof-mattei

Update:

When deleting /usr and /var from the tar the import works (WSL obviously doesn't work then...).

I'm suspecting either conflicts with the overlay2 fs (docker), and/or the fact that in many folders there are files which only differ by case, not by name.

kristof-mattei avatar Jan 21 '20 22:01 kristof-mattei

Same for me. Unspecified Error each time I try the wsl --import command on a previously exported (in.tar) image

antonymarion avatar Mar 12 '20 10:03 antonymarion

Same for me.

davidwudv avatar Mar 23 '20 07:03 davidwudv

What worked for me was importing the WSL 2 distribution as WSL 1 using --import ... --version 1, and then convert it to version 2 using --set-version.

nimamahmoudi avatar Apr 19 '20 23:04 nimamahmoudi

But obviously this is a temporary workaround. In my case, the import would cause the RAM utilization to go to about 95%, and then I would see the aforementioned error. It seems like there is something wrong with importing large image sizes (mine was about 18GB).

nimamahmoudi avatar Apr 20 '20 00:04 nimamahmoudi

Same here. @nimamahmoudi's method works but now running "wsl -d MyImportedDistrib" give me a root prompt instead of the correct user... ^^' (the import process can be speedup by excluding the install directory in defender...)

KnuX avatar May 02 '20 19:05 KnuX

@KnuX that is expected. https://github.com/microsoft/WSL/issues/3974 see here for fixes :)

kristof-mattei avatar May 06 '20 21:05 kristof-mattei

Ran into the same issue, which appears to be related to RAM. I'm on 8GB trying to import an image that is also about 8GB. I was able to get around this issue by temporarily increasing the virtual RAM to 16GB.

https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/how-to-increase-virtual-memory-in-windows-10-a/46dacaf5-15cf-4f5d-9d5a-cba1401ae4c9

CharlieTheProgrammer avatar May 25 '20 17:05 CharlieTheProgrammer

I was getting this error on my WSL2 image which was 45GB. I ended up installing a new Ubuntu WSL2 instance then just copying over my vhdx file. Just had to setup my user again as it was logging in with as root.

jerrodrs avatar Jun 05 '20 00:06 jerrodrs

The import fails for me with the Unspecified error regardless of whether I try version 1 or version 2. I have 16G of memory, the image size is about 2G. Is there any way to diagnose further?

alexvorobiev avatar Jun 12 '20 03:06 alexvorobiev

I got same sutiation, after that I set "swap=120GB" in .wslconfig file, it worked! @Kristof-Mattei this may be memory lack caused

stormysky avatar Jun 29 '20 03:06 stormysky

@nimamahmoudi solution of importing as v1 then converting was the only one that worked for me.

ss44 avatar Jul 18 '20 15:07 ss44

Only thing that worked for me was importing as v1 and turning it into v2.

charlysotelo avatar Jul 18 '20 16:07 charlysotelo

@stormysky Where is the .wslconfig file stored for WSL2? Or if it's not existing you need to create it by your own?

For me importing as V1 and converting then has worked out, but I've been able to login as root by default after re-import (not sure if it's connected to converting). So had to patch the register to fix it to my primary OS user.

adolgoff avatar Aug 02 '20 08:08 adolgoff

@adolgoff .wslconfig need to created by own strored at current user path (c:\users\xxxx, xxx is current user), here is my configuration [wsl2] memory=6GB swap=2GB

stormysky avatar Aug 06 '20 07:08 stormysky

None of these work for me, I've tried importing as v1 as well as modifying .wslconfig. No luck. Also tried wsl --shutdown and then issuing that command.

bobbbay avatar Oct 27 '20 04:10 bobbbay

I solved this problem after compact my wsl vdisk: wsl --terminate ubuntu-18.04 diskpart DISKPART> select vdisk file=%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\ext4.vhdx DISKPART> compact vdisk After that, please try wsl export and wsl import again.

billy-tsai avatar Apr 16 '21 09:04 billy-tsai

Maybe a duplicate of issue #4735.

Yogurt4 avatar May 09 '21 16:05 Yogurt4

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!