WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL is not starting

Open gilbmporto opened this issue 4 years ago • 31 comments

Version

22621.755

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.15.68.1

Distro Version

2004.2022.1.0

Other Software

No response

Repro Steps

Trying to open the WSL2 enviroment through windows terminal and through VS Code.

Expected Behavior

WSL2 should be initialized.

Actual Behavior

It's not being initialized through any means at all. Not through windows terminal, or VS Code, or Linux subsystem. I already tried everything, it simply doesn't initialize. screenshot-01 screenshot-02 screenshot-03

Diagnostic Logs

No response

gilbmporto avatar Oct 27 '22 22:10 gilbmporto

/logs

OneBlue avatar Oct 27 '22 22:10 OneBlue

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

ghost avatar Oct 27 '22 22:10 ghost

Thank you @gilbmporto.

I'm not seeing any wsl logs in the file you share. Does wsl start if you just run cmd.exe in a command prompt ?

OneBlue avatar Oct 27 '22 23:10 OneBlue

It doesn't start anywhere at all. After a really long time, inside the windows terminal, this appeared:

The operation could not be started because a necessary resource was not installed. Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE

[process closed with the code 4294967295 (0xffffffff)]

gilbmporto avatar Oct 28 '22 00:10 gilbmporto

I want to say, as well, that until yesterday, it was working normally. After the automatic windows update, which was made yesterday at night, this issue started.

gilbmporto avatar Oct 28 '22 00:10 gilbmporto

Interesting. I wonder if the virtual machine platform feature got in a bad state.

Can you try to disable the Virtual Machine Platform feature in optionalfeatures.exe, then reboot, then enable it again, reboot and see if that solves the issue ?

OneBlue avatar Oct 28 '22 00:10 OneBlue

Yes, just did it right now and it still does not start. ):

gilbmporto avatar Oct 28 '22 01:10 gilbmporto

I have encountered exactly the same issue. After the latest update WSL will not start. But I have noticed that if I open WSL immediately after a fresh boot then it will be OK. If I leave it for a few minutes after a fresh boot then it become unresponsive.

CuttlefishJones avatar Oct 28 '22 13:10 CuttlefishJones

FYI this entry is appearing in the event log:

Failed to map guest I/O buffer for read access with status 0xC00000A1.

CuttlefishJones avatar Oct 28 '22 13:10 CuttlefishJones

I have encountered exactly the same issue. After the latest update WSL will not start. But I have noticed that if I open WSL immediately after a fresh boot then it will be OK. If I leave it for a few minutes after a fresh boot then it become unresponsive.

I see. In my case, it doesn't start whatsoever. It just keeps loading, until it terminates itself a very long time then.

gilbmporto avatar Oct 28 '22 13:10 gilbmporto

Thank you @gilbmporto. I'd be curious to see logs right after startup.

Can you please try to:

  • reboot the machine
  • Start a new log collection before running any wsl command
  • Then run wsl.exe in a terminal and wait until you see the error you shared below
  • Stop the collection
  • Share the log file on this issue

/logs

OneBlue avatar Oct 28 '22 18:10 OneBlue

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

ghost avatar Oct 28 '22 18:10 ghost

There it goes: WslLogs-2022-10-28_16-25-56.zip The one up above is just before opening the anything associated with the linux subsystem.

WslLogs-2022-10-28_16-30-47.zip Now, this one above is just after this error down below appears at windows terminal (which is configured to open Ubuntu)

Captura de tela 2022-10-28 165833

PS: This language is brazilian portuguese, but I suppose that, what matters anyway is the error code.

gilbmporto avatar Oct 28 '22 20:10 gilbmporto

I'm having the same issue. I restarted my computer but am still getting the error below (same error code as OP):

The virtual machine or container with the specified identifier is not running. [process exited with code 4294967295 (0xffffffff)]

wsl -lv output:

  NAME            STATE           VERSION
* Ubuntu-18.04    Stopped         2
  • Windows version: 10.0.19044 Build 19044
  • WSL version: 2

Unfortunately the diagnostic script itself fails for me, so I can't run that.

get-acl : Cannot find path 'C:\ProgramData\Microsoft\Windows\WindowsApps' because it does not exist.
At C:\WINDOWS\system32\collect-wsl-logs.ps1:35 char:1
+ get-acl "C:\ProgramData\Microsoft\Windows\WindowsApps" | Format-List  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
    + FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand

However, what did work for me is to just go into command prompt and run wsl. It was not working when I tried running Windows Terminal or the distro itself, but the CLI did work. With WSL running from command prompt, I was then able to launch Windows Terminal and access my distro.

AleksandrHovhannisyan avatar Oct 29 '22 12:10 AleksandrHovhannisyan

I have managed to get WSL to restart by force killing the WslService process:

sc queryex WslService

I grabbed the PID from the output of the above and then:

taskkill /PID "PID" /F

This force restarted the WSL service and I was able to regain access.

CuttlefishJones avatar Oct 31 '22 12:10 CuttlefishJones

I have managed to get WSL to restart by force killing the WslService process:

sc queryex WslService

I grabbed the PID from the output of the above and then:

taskkill /PID "PID" /F

This force restarted the WSL service and I was able to regain access.

Tried this here... Didn't work. :(

gilbmporto avatar Nov 01 '22 02:11 gilbmporto

I'm having the same issue. I restarted my computer but am still getting the error below (same error code as OP):

The virtual machine or container with the specified identifier is not running. [process exited with code 4294967295 (0xffffffff)]

wsl -lv output:

  NAME            STATE           VERSION
* Ubuntu-18.04    Stopped         2
  • Windows version: 10.0.19044 Build 19044
  • WSL version: 2

Unfortunately the diagnostic script itself fails for me, so I can't run that.

get-acl : Cannot find path 'C:\ProgramData\Microsoft\Windows\WindowsApps' because it does not exist.
At C:\WINDOWS\system32\collect-wsl-logs.ps1:35 char:1
+ get-acl "C:\ProgramData\Microsoft\Windows\WindowsApps" | Format-List  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
    + FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand

However, what did work for me is to just go into command prompt and run wsl. It was not working when I tried running Windows Terminal or the distro itself, but the CLI did work. With WSL running from command prompt, I was then able to launch Windows Terminal and access my distro.

I see. In my case, I tried that as well, but it didn't work here too.

gilbmporto avatar Nov 01 '22 02:11 gilbmporto

Thank you for the logs @gilbmporto.

Looking at the logs, this looks like a control flow guard related error.

Can you share the output of both (in an elevated powershell):

  • Get-ProcessMitigation -System
  • Get-ProcessMitigation | Where-Object { $_.ProcessName.contains("vmcompute") } l ?

OneBlue avatar Nov 04 '22 21:11 OneBlue

Same problem here, I have to always restart the machine after first turning it on in the morning after first turning it on wsl just gives a blank screen after restart always works fairly recent situation so it appears some update has caused this

tomcon avatar Nov 05 '22 09:11 tomcon