Skip to content

Conversation

@benhillis
Copy link
Member

This change adds back the VM ID environment variable to the system distro (WSLg runtime environment). Turns out weston has a dependency on this environment variable: https://github.com/microsoft/weston-mirror/blob/2318fecaeac1f1a2d5a7a042c34d931c71dae04c/rdprail-shell/shell.h#L56

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores the WSL2_VM_ID environment variable for the system distro (WSLg runtime environment) by conditionally preserving it when the system distro is detected. The change addresses a dependency in the weston mirror project where the VM ID is required. The logic uses the presence of LX_WSL2_SHARED_MEMORY_OB_DIRECTORY to distinguish system distros (which need the variable) from user distros (where it should remain unset for privacy).

Key changes:

  • Modified environment variable cleanup logic to preserve WSL2_VM_ID for system distros while still removing it for user distros
  • Added conditional check using LX_WSL2_SHARED_MEMORY_OB_DIRECTORY as the discriminator between distro types

Copy link
Collaborator

@OneBlue OneBlue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should also consider adding test coverage for the wslg shortcut creation logic (can be done in followup PR though)

@benhillis benhillis changed the title Add back WSL2_VM_ID environment varialbe to the system distro. Add back WSL2_VM_ID environment variable to the system distro. Dec 5, 2025
@benhillis benhillis merged commit 7741740 into master Dec 5, 2025
12 checks passed
OneBlue pushed a commit that referenced this pull request Dec 12, 2025
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.

4 participants