Closed Athanasius closed 1 year ago
After another reboot I tried this by actually logging in as an Admin account and running PowerShell, and the command worked.
So, WSL requires the current Windows session to be an Admin user ? You can't just "Run as Administrator" ?
Oh, it's also working as my non-Admin user without running PowerShell as Administrator. So this:
Open PowerShell or Windows Command Prompt in administrator mode by right-clicking and selecting "Run as administrator", enter the wsl --install command, then restart your machine.
from https://learn.microsoft.com/en-gb/windows/wsl/install is at best misleading, and probably just plain wrong, at least for this Windows Store version of WSL ?
Thank you for reporting this @Athanasius. I wonder if this a store issue. Can you try installing via:
wsl --install -d debian --web-download
?
Thank you for reporting this @Athanasius. I wonder if this a store issue. Can you try installing via:
wsl --install -d debian --web-download
Right now it will succeed even without --web-download
because the system already has the distribution. Checking wsl --help
there only seems to be wsl --unregister <Distribution>
(as per --list
), but after that even wsl --install -d Debian
quickly succeeds, presumably because the download has been cached.
Some websearching later I find https://petri.com/how-to-uninstall-and-reset-windows-subsystem-for-linux-distributions/ and remove 'Debian' from "Apps > Installed apps", and now:
PS C:\WINDOWS\system32> wsl --install -d Debian
Debian GNU/Linux is already installed.
Launching Debian GNU/Linux...
Failed to attach disk 'C:\Users\Athan\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState\ext4.vhdx' to WSL2: The system cannot find the file specified.
Error code: Wsl/Service/CreateInstance/MountVhd/ERROR_FILE_NOT_FOUND
Press any key to continue...
So, that's only gotten it into an even worse state.
How do I make WSL actually forget about the distribution so I can even test if --web-download
would have worked ?
Having gone through even more of a dance now.
wsl --unregister Debian
as Limited user (all the last comment was under PowerShell > Run as Administrator).This now appears to work. So, either something has been fixed in the meantime... or it's just a consequence of this now not being a WSL clean system, with something left behind allowing it to work.
I don't have the time or resources to re-test this from scratch now.
PS C:\Windows\system32> wsl --status Default Version: 2
Windows Subsystem for Linux was last updated on 5/2/2024 The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings. To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'. For more information please visit https://aka.ms/wsl2kernel.
Kernel version: 5.10.16 PS C:\Windows\system32> wsl --install -d ubuntu Installing: Ubuntu An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x80070520 PS C:\Windows\system32> wsl --install -d ubuntu --web-download --install: unrecognized option: web-download
I get exactly same error when trying to install Ubuntu. Any updates on this topic ?
Windows Version
Microsoft Windows 11 Pro [22621.1702]
WSL Version
1.2.5.0
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
Debian
Other Software
No response
Repro Steps
Trying out the Windows Store preview as per https://devblogs.microsoft.com/commandline/a-preview-of-wsl-in-the-microsoft-store-is-now-available/#:~:text=There%20are%20two%20big%20reasons%20to,when%20getting%20the%20latest%20WSL%20updates.&text=There%20are%20two%20big,the%20latest%20WSL%20updates.&text=two%20big%20reasons%20to,when%20getting%20the%20latest
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all
command.wsl --list --online
, which includes a lineDebian Debian GNU/Linux
wsl --install --distribution Debian
results in:Expected Behavior
Debian distribution should be installed.
Actual Behavior
The cited error.
Diagnostic Logs
No response