Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upgrade to WSL 2, I'm getting this error (The system cannot find the file specified.) #6341

Closed
nagarajcruze opened this issue Dec 15, 2020 · 24 comments

Comments

@nagarajcruze
Copy link

nagarajcruze commented Dec 15, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.685]
Your Distribution version: Release:        20.04
Whether the issue is on WSL 2( WSL 1 works fine) : Linux version 4.4.0-19041-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #488-Microsoft Mon Sep 01 13:43:00 PST 2020

Steps to reproduce

  1. I have two partition, C and D. by default ubuntu wsl 2 installed on C drive and I was using it without any problems, then two weeks before my C drive started to full, so I tried to move wsl distro to D drive [followed this->] (how to move the vhdx of wsl2 to other disk MicrosoftDocs/WSL#412 (comment)).
  2. This method worked fine and I was using wsl2 ubuntu without any problems. Then two days before again the C drive started to full.
  3. This time I took a backup of the (Ubuntu.vhdx file, i just moved it to my external drive) and deleted the entire D drive and and extended C drive to get space.
  4. Then I installed wsl2 ubuntu from store and it is installed to C drive, now I overwrite the ubuntu file located under C:\Users<username>\AppData\Local\Packages<distro-name>\localstate\distro.vhdx (This time I didn't followed this (how to move the vhdx of wsl2 to other disk MicrosoftDocs/WSL#412 (comment)) I simply overwrited the .vhdx file)
  5. Now the problem Started.

WSL logs:
This is my feedback
https://aka.ms/AAamegk

Expected behavior

I want to use wsl 2 distros instead wsl 1.

Actual behavior

If I install any distro from Microsoft store, by setting WSL version 1 by default, then i can install any distro and works fine.
Like in this image
image-1

If I change WSL default version to 2 then installing any version gives this error.
Same will happen even after installing distro as WSL version 1 then upgrading to WSL version 2.
image-2

Any fixes I tried before opening this issue?

Yes,

  1. Uninstalled Virtaul box, Vmware, Docker desktop then rebooted, fixed? NO.
  2. Uninstalled all Vbox/VMware Network Drivers, fixed? NO
  3. Removed all the distro by wsl --unregister and also from settings -> apps --> Uninstall, then freshly installed from microsoft store. fixed? NO.
  4. Again did the above steps, along with removed wsl 2 update package(kernel), fixed? NO.
    Finally,
    Again Uninstalled everything like 3rd step, also turned off Windows Optional Features ( Windows Subsystem for Linux , Virtual Machine Platform, Windows Hypervisor Platform) and did everything from first following this https://docs.microsoft.com/en-us/windows/wsl/install-win10 fixed, NO.

I don't understand anything, say in simple words, From where/when the problem started?

After I overwrite my backed-up ubuntu.vhdx file with the freshly installed ubuntu.vhdx file.

@nagarajcruze
Copy link
Author

@licanhua can you please help me now?

@licanhua
Copy link
Collaborator

Thanks for your logs. Unfortunately it doesn't provide the information I need.

If I understand your scenario correctly, you were actually using WSL 2, and then you backed up your system as .vhdx. (only wsl 2 use vhdx).
So your restore procedure should like this:

  1. uninstall the ubuntu from the system (because it's wsl 1 in your wsl -l -v)
  2. wsl --set-default-version 2 to set the default version to 2
  3. install ubuntu again. wsl -l -v, and check Ubuntu is wsl 2
  4. wsl --shutdown, and replace Ubuntu.vhdx with the backup
  5. start Ubuntu

@nagarajcruze
Copy link
Author

sir, You meant? should I want to do this now? or you are guuessing that this is how I have done previously?

@nagarajcruze
Copy link
Author

if I follow the steps you say, from 2nd step, after I set the default version to 2.
I'll go and install Ubuntu from Microsoft store, if I click launch button on Microsoft store a CMD prompt will open, let me add the screenshot.
image-2
you can see the same error.

@licanhua
Copy link
Collaborator

@benhillis Do you have any idea why this happen, or continue the investigation? Log is provided, but there is no WSL or network logs in it.

@benhillis
Copy link
Member

@licanhua - where is the file not found error coming from?

@licanhua
Copy link
Collaborator

I have no idea because there is no log. network?

@licanhua
Copy link
Collaborator

@nagarajcruze, can you check if C:\Windows\System32\VmSynthNic.dll exists

@benhillis
Copy link
Member

I did not see any repro logs attached to the feedback hub item.

@nagarajcruze
Copy link
Author

@licanhua yup, it is there.
@benhillis what's that repro logs? let me try to get that.

@ghost ghost removed the needs-author-feedback label Dec 16, 2020
@licanhua
Copy link
Collaborator

You can try collect logs via logman

@nagarajcruze
Copy link
Author

nagarajcruze commented Dec 16, 2020

Done, Look at it, please.
in the image, first time running kali is not worked coz i have uninatalled it, again i installed from store, then the sommand worked.
But it didn't launched.
logman_logs.zip
image-3

@licanhua
Copy link
Collaborator

@benhillis The error is raised when creating the network.
HcnCreateNetwork failed {"Success":false,"Error":"The system cannot find the file specified. ","ErrorCode":2147942402}

@nagarajcruze I don't know too much about the networking. Here are two workarounds from the community which may help on your problem:

  1. If you enabled HotSpot, please disable them, and uninstall "Microsoft Wi-Fi Direct Virtual Adapter"
  2. netsh winsock reset and netcfg -d

@nagarajcruze
Copy link
Author

@licanhua netcfg -d removed all my network drivers, now the drivers are not getting installed automatically, I can't access to the internet. 😐
IMG_20201216_121219_1

And also i tried to install kali-linux wsl 2, again the same error.

@licanhua
Copy link
Collaborator

very sorry to hear that. Have you reboot the machine after the change?

@nagarajcruze
Copy link
Author

Yes, i have rebooted. Then nothing worked. Installed network drivers from official site, nothing worked, did network reset, nothing worked, now I'm taking backup of my files and going to reset Windows.
Thanks for your help.
Can i reset ?

@huserman
Copy link

huserman commented Dec 16, 2020

  1. uninstall the ubuntu from the system (because it's wsl 1 in your wsl -l -v)
  2. wsl --set-default-version 2 to set the default version to 2
  3. install ubuntu again. wsl -l -v, and check Ubuntu is wsl 2
  4. wsl --shutdown, and replace Ubuntu.vhdx with the backup
  5. start Ubuntu

I followed these steps, but can't upgrade to WSL-2. So, I think this is about the version of Windows 10 we have (Version 20H2 OS Build 19042.685), which seems doesn't support WLS-2 yet.

@licanhua
Copy link
Collaborator

licanhua commented Dec 17, 2020

@nagarajcruze I would try Network troubleshooter first which is in settings page

@huserman what's your error? I'm with 10.0.19042.630 and didn't see WSL 2 error, so your OS should support WSL2 except you are using Windows Server, or some OEM version(possible)

@huserman
Copy link

huserman commented Dec 17, 2020

@nagarajcruze I would try Network troubleshooter first which is in settings page

@huserman what's your error? I'm with 10.0.19042.630 and didn't see WSL 2 error, so your OS should support WSL2 except you are using Windows Server, or some OEM version(possible)

There are no errors, after successfully running all the necessary steps - when I execute wsl --set-default-version 2 I'm just getting a message to read more about wsl2. I'm on Windows Pro with enabled virtualization.

UPD: Ok, resolved in my case after restarting. Just installed Debian and wsl -l -v shows Version 2. I basically, removed all previous instances then I was trying to upgrade from wsl-1 to wsl-2. Last step I did, was turning off wsl from Windows features and then turning it on with restarting on both cases.

@nagarajcruze
Copy link
Author

  1. uninstall the ubuntu from the system (because it's wsl 1 in your wsl -l -v)
  2. wsl --set-default-version 2 to set the default version to 2
  3. install ubuntu again. wsl -l -v, and check Ubuntu is wsl 2
  4. wsl --shutdown, and replace Ubuntu.vhdx with the backup
  5. start Ubuntu

I followed these steps, but can't upgrade to WSL-2. So, I think this is about the version of Windows 10 we have (Version 20H2 OS Build 19042.685), which seems doesn't support WLS-2 yet.

In the steps above, after the 2nd step I can't install from Store, after I downlead the distro then I press the launch button, the same error will get throwed in the CMD, so it's failed. But I was using WSL 2 in 20H2 without any problems, I just made some mistakes and caused those errors.

@nagarajcruze
Copy link
Author

@nagarajcruze I would try Network troubleshooter first which is in settings page

@huserman what's your error? I'm with 10.0.19042.630 and didn't see WSL 2 error, so your OS should support WSL2 except you are using Windows Server, or some OEM version(possible)

I tried that too, No luck. It said everything is fine. Even after I did this "netcfg -d" I lost all my network adapters and of course I can't access to the internet, still Network troubleshooter said, everything is fine, xD.

@nagarajcruze
Copy link
Author

Finally, I solved my problem by resetting my Windows, I lost all my Apps and settings but that's not a problem.
I can't find what caused these problems.
@licanhua can I close this issue?

@licanhua
Copy link
Collaborator

yes.

@nagarajcruze
Copy link
Author

@licanhua @benhillis Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants