microsoft / WSL

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

Windows Insider Preview update causes WSL to fail to run and prevents reinstallation [Version 10.0.26100.1] #11495

Open tanaous opened 4 months ago

tanaous commented 4 months ago

Windows Version

Microsoft Windows [Version 10.0.26100.1]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

wsl --uninstall
dism /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /Remove dism /online /disable-feature /featurename:VirtualMachinePlatform /Remove restart dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart restart wsl --install

Expected Behavior

I originally had a normally functioning WSL environment with Ubuntu as the operating system. However, after I upgraded to the latest Windows Insider Preview (I have been on this channel for a while without any issues), WSL failed to start, indicating that I needed to reinstall it (providing an MSI file for WSL2). But the installation encountered an error (even when the required MSI file was provided). So, I used the command wsl --uninstall to remove the WSL component, disabled the Linux subsystem feature, and restarted. After re-enabling the Linux subsystem and virtual machine feature components, and another restart, the installation using the command wsl --install failed again. The issue is reproducible. The logs from the reproduction process are in the attachment.

Actual Behavior

PS C:\WINDOWS\system32> wsl --install Downloading: Windows Subsystem for Linux 2.1.5 Installing: Windows Subsystem for Linux 2.1.5 Catastrophic failure PS C:\WINDOWS\system32>

====="Original Output: Chinese Version"===== PS C:\WINDOWS\system32> wsl --install 正在下载: 适用于 Linux 的 Windows 子系统 2.1.5 正在安装: 适用于 Linux 的 Windows 子系统 2.1.5 灾难性故障 PS C:\WINDOWS\system32>

Diagnostic Logs

WslLogs-2024-04-22_20-30-54.zip

github-actions[bot] commented 4 months ago

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
Found '/feature', adding tag 'feature'
.wslconfig found
Appx package is not installed

OneBlue commented 4 months ago

@pmartincic: Looks like this user is hitting the MSIX install issue. This would be a good test for the installer fixes you're working on.

Microsoft.Windows.Subsystem.Lxss    LxssException   04-22-2024 05:31:30.229 "   "   "Code:  
File:   D:\a\1\s\src\windows\wslinstall\DllMain.cpp
FunctionName:   
HRESULT:    0x80070032
Line number:    46
Message:    Source: unsigned int __cdecl InstallMsix(unsigned long)() - D:\a\1\s\src\windows\wslinstall\DllMain.cpp:505
Type:   0
wslVersion:     2.1.5.0"                11452   29356   2       2e99a5db-94ac-000b-1d61-9c2eac94da01        
zrainbowk commented 3 months ago

1、按win+R键打开运行,输入【gpedit.msc】,打开【本地组策略编辑器】 2、依次展开【计算机配置–>管理模板–>Windows组件–>应用程序包部署】,找到【允许开发Windows应用商店并从集成开发环境(IDE)安装】和【允许所有受信任的应用程序】,双击进入设置界面,选择【已启用】,然后后击【应用】确定即可。 3、打开管理员权限的 PowerShell。运行以下命令: Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux -AllUsers | Remove-AppxPackage wsl --update --web-download

如果不行,尝试增加以下操作后再次运行第三步: 1、打开 设置 > 系统 > 存储。在 更多存储设置 下,点击 更改新内容的保存位置。确保 新应用将保存到 设置为系统驱动器(C:)。 2、第二步中的应用程序包部署的各项设置,都设置为不会阻止安装的状态。

luke396 commented 2 months ago

1、按win+R键打开运行,输入【gpedit.msc】,打开【本地组策略编辑器】

新版的win11中似乎无法找到和打开策略组,我利用以下得到修复。

  1. 打开 设置 > 系统 > 存储。在 更多存储设置 下,点击 更改新内容的保存位置。确保 新应用将保存到 设置为系统驱动器(C:)。

  2. 打开管理员权限的 PowerShell。运行以下命令: Get-AppxPackage MicrosoftCorporationII.WindowsSubsystemForLinux -AllUsers | Remove-AppxPackage wsl --update --web-download

此时就已经完成新版本的安装。

一个可能潜在的问题是(不确定是否是由于上述直接引起),之后以code .方式在wsl中启动vscode会弹出 Updates are disabled because you are running the user-scope installation of Visual Studio Code as Administrator. (在桌面上(非wsl中)启动vscode,仍然可以正常更新。)

Hakuin123 commented 1 month ago

同样尝试前两步成功安装,感谢大佬 另外,Windows家庭版不支持组策略

Ariesla commented 1 month ago

感谢大佬