Skip to content

Conversation

rtrevi
Copy link

@rtrevi rtrevi commented Oct 2, 2025

  • Removes inspection of /proc/version strings for detecting WSL1 or WSL2. /proc/version is inherited by containers within WSL, causing gcm to wrongly identify these containers as WSL distros: Bug: GCM Misidentifies Docker Containers Running on WSL2 Due to /proc/version #1813

  • Inspects /proc/sys/fs/binfmt_misc/WSLInterop and /proc/sys/fs/binfmt_misc/WSLInterop-Late for respectively detecting WSL1 or WSL2. This is consistent across distros and the files aren't inherited into containers.

  • Removes inspection of WSL_INTEROP env var for detecting WSL2. Deemed not necessary anymore.

@rtrevi rtrevi requested a review from a team as a code owner October 2, 2025 20:13
@rtrevi
Copy link
Author

rtrevi commented Oct 2, 2025

First contribution, be gentle :)

@becm
Copy link

becm commented Oct 3, 2025

Sadly #1813 is sort of a collection of curve-balls:

  • GetWslVersion was (effectively) fine as-is (albeit I'd support dropping the confusing interop test there)
  • detection of "WSL-interop case for the Browser" (the relevant condition) should be a separate check
    • wsl (→ GetWslVersion with uname-only check should be fine)
    • valid mountpoints (sadly GetSystemDriveMountPath has a default fallack → retest required)
    • interop (insert binfmt check here ☺)
    • and only then use Powershell to check SessionId
    • allow falling back to IsDesktopSession (use browser within the WSL or container scope)
  • that check must be used consistently at the correct position in OpenDefaultBrowser
  • the presence of wslview does not help, as it relies on interop capabilities (and the project is now PPA only).

In the interop-capable case the Browser should to be started by raw

<wslmount>/Windows/System32/cmd.exe /c start <url>

(or an equivalent powershell command) on the host Windows system,
ideally encapsulated in something like WslUtils.openUrl().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants