-
Notifications
You must be signed in to change notification settings - Fork 263
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
Multiple components silently fail to detect WSL version #5551
Comments
Same issue here with the latest wsl2 pre-release, rancher desktop is stuck in the initializing phase |
Ah, we're doing a bad thing and parsing a string that's meant to be user-visible. On English Windows:
So in our code, we look for a line that starts with
So we fail to find the version. And there's an additional issue where failing to find the version blows up in our face completely. |
Maybe we can check Store versions with PS C:\Users\SUSE> (Get-AppxPackage | ? Name -eq "MicrosoftCorporationII.WindowsSubsystemforLinux").Version
1.2.5.0 And only if that fails fall back to check the in-box version PS C:\Users\SUSE> (get-item $env:SystemRoot\system32\wsl.exe).VersionInfo.ProductVersion
10.0.22621.1 |
I think it's safe/reasonable enough to simply parse the version number in the first line of output. While I don't have any other languages installed right now, I could imagine a French version printing Maybe it's best to just match something like This should avoid matching the wrong line, like the WSLg version number. |
I think it is always preferable to get the information you want from an API instead of scraping output meant for human consumption. Checking some European languages using the Roman alphabet and left-to-right parsing is one thing, but what about Hebrew, Chinese etc? And Microsoft can change the output of |
Yeah, you can actually get Windows to download language packs in Settings (I think?); I checked Chinese and German, since I'm mostly going by menu item position :) I'm hoping to get something using |
This may be sufficient in this case because WSL comes from the store, but in general installing a language pack is not quite the same as having the language specific version of Windows installed, which is fully localized instead of just using different message catalogs for system components. |
That part is – as far as I know – no longer true. There's no difference anymore. There's only one installation medium/master and the UI language is indeed defined by installed language packs only (which also determine what should be loaded alongside store downloads).
Yep, true, but is there an universal API way to get the version? I just checked and the standalone version comes within an MSIX Package, so I guess it would work in either case? Even for self-compiled/installed? |
Actual Behavior
I was confused about not seeing the update offer to 1.10, then checked the logs and noticed multiple of them fail the version check
since I've installed WSL2 version 2.0.0 (currently in pre-release).Steps to Reproduce
Update WSL2 to the latest pre-release usingwsl --update --pre-release
.wsl --version
doesn't look EnglishWSL Version: …
.Result
Expected Behavior
Ideally the version detection should just work. I'd at least expect a notice under "Diagnostics" without me digging through log files.
Additional Information
update.log as example:
Rancher Desktop Version
1.10.0
Rancher Desktop K8s Version
1.25.6
Which container engine are you using?
containerd (nerdctl)
What operating system are you using?
Windows
Operating System / Build Version
Windows 11 22H2 22621.2283
What CPU architecture are you using?
x64
Linux only: what package format did you use to install Rancher Desktop?
None
Windows User Only
N/A
The text was updated successfully, but these errors were encountered: