Fix: delay plan9 registration after OOBE#40977
Open
chemwolf6922 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a WSL2 Plan9/\\wsl.localhost ownership regression on fresh installs by deferring Plan9 redirector connection-target registration until after OOBE completes, so Windows-initiated file operations use the correct default UID instead of a pre-OOBE cached value (often UID 0).
Changes:
- Register the Plan9 redirector connection target after successful OOBE completion (once
DefaultUidis known). - Skip Plan9 connection-target registration while OOBE is still pending for the distro.
- Extend
ModernOOBEunit test coverage to verify\\wsl.localhostaccess is blocked pre-OOBE and that files created post-OOBE have the expected UID.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/windows/service/exe/WslCoreInstance.cpp |
Delays Plan9 connection-target registration until after successful OOBE, ensuring correct UID is used. |
test/windows/UnitTests.cpp |
Updates ModernOOBE test to validate pre-/post-OOBE \\wsl.localhost behavior and resulting file ownership. |
benhillis
reviewed
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Currently, after a fresh distro installation, operations in the linux plan9 share will use the uid 0. Because the uid was cached before the OOBE is complete. And this only recovers after a distro termination.
This PR delays the plan9 registration after the OOBE completes with the correct default uid.
PR Checklist
\\wsl.localhostcreate files owned by root (UID 0) instead of WSL default user #40941Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Updated the test UnitTests::UnitTests::ModernOOBE to verify this change.