microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.19k stars 806 forks source link

WSL2 access denied error/catastrophic failure when trying to start distro #8891

Open localpath opened 1 year ago

localpath commented 1 year ago

Version

Microsoft Windows [Version 10.0.22000.978]

WSL Version

Kernel Version

Kernel version: 5.10.102.1

Distro Version

Ubuntu-22.04

Other Software

Docker Desktop windows v4.12.0 Visual Studio Code w/ Remote Desktop Extension v1.71.2

Repro Steps

I updated my windows 11 pc and now permission denied to access WSL via explorer and other apps hang indefinitely or crash trying to access distro.

2022-09 Cumulative Update Preview for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 11 for x64 (KB5017859)

Expected Behavior

I can access the distro as normally.

Actual Behavior

Screenshot 2022-09-26 083558

Diagnostic Logs

PS C:\Users\garri> wmic diskdrive get Availability,Capabilities,CapabilityDescriptions,DeviceID,InterfaceType,MediaLoaded,MediaType,Model,Name,Partitions
Availability  Capabilities  CapabilityDescriptions                                       DeviceID            InterfaceType  MediaLoaded  MediaType              Model                         Name                Partitions
              {3, 4, 10}    {"Random Access", "Supports Writing", "SMART Notification"}  \\.\PHYSICALDRIVE0  SCSI           TRUE         Fixed hard disk media  NVMe PC711 NVMe SK hynix 1TB  \\.\PHYSICALDRIVE0  5
PS C:\Users\garri> wsl
Catastrophic failure
benhillis commented 1 year ago

/logs

ghost commented 1 year ago

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!

localpath commented 1 year ago

@benhillis I exported the distro so I could move some version controlled work to my remote. It was mission critical so I couldn't delay. I uninstalled Ubuntu 22.04 via Windows apps and features before you pinged this issue. I have reinstalled Ubuntu 22.04 so I can get set back up. This is the second time this same issue has happened. Not sure if registry keys are getting messed up during a system update?

Thanks!!

WslLogs-2022-09-26_11-40-36.zip

localpath commented 1 year ago

Bump. The system just bricked again. Same error. System went into read-only in distro after restart cannot access files or start WSL Distro

localpath commented 1 year ago

@benhillis Seems stable now that I restored my distro from the export instead of pulling it in from Windows store. I'm guessing there's something weird about installing 22.04 from store as opposed to manually?

VyacheslavZinch commented 1 year ago

try this :

chrisxfire commented 1 year ago

Sharing that I experienced the same as OP. Installing the Hyper-V Windows feature resolved. Note that the Windows Subsystem for Linux, Windows Hypervisor Platform, and Virtual Machine Platform were previously installed.

OS Name: Microsoft Windows 10 Pro OS Version: 10.0.19045 N/A Build 19045

IsraPerez98 commented 1 year ago

For anyone having this problem after enabling SystemD support following this guide, please make sure to install systemd on your distro.

I was running fedora in WSL and faced this issue, running sudo dnf install systemd before enabling support with the wsl.conf file fixed the problem.

blami commented 1 year ago

In case someone using Debian derivative distro runs into this, packages required to successfully start with systemd enabled on Debian are systemd and systemd-sysv. Especially if running Debian rootfs imported from Docker image, make sure to run apt-get install systemd systemd-sysv before enabling systemd.

Would be probably nice if WSL checked if systemd is installed and only then honored systemd setting in wsl.conf.

s3989 commented 1 year ago

hi i cannot install wsl, I try everything already: admin power shell, the manual way,wsl --update, wsl --install -d Ubuntu-18.04,and etc. every thing you could just think of and i keep on getting this error: Catastrophic failure Can you help me solve it please?

cristian-radu commented 1 year ago

Ran into this issue today. In case it helps someone out ... WslLogs-2023-08-11_15-44-25.zip

Some Windows updates got automatically installed on my machine. Then the filesystem of my Ubuntu-22.04 WSL got remounted as read-only. I rebooted and could not start Ubuntu-22.04 WSL at all.

C:\Users\cristian>wsl
Catastrophic failure

Somehow the filesystem of Ubuntu-22.04 became completely inaccessible. I could not access it even through the Windows file explorer.

I managed to get it back up and running by doing a separate update of wsl from the command line.

C:\Users\cristian>wsl --update
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.

C:\Users\cristian>wsl
cristian@rancor:/mnt/c/Users/cristian$

In the meantime, GitHub Codespaces saved my a$$ and allowed me to carry on working.

rikrdo89 commented 2 months ago

thank you @cristian-radu ! I also got a "catastrophic failure" when trying to start wsl. Running wsl --update from Powershell with admin rights solved the issue for me.