Skip to content
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

Enables checking if localhost forwarding is disabled #218

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

CarlosNihelton
Copy link
Collaborator

@CarlosNihelton CarlosNihelton commented Jul 11, 2022

That feature enables binding WSL 2 localhost to Windows localhost, thus enabling transparent connection through TCP where the client is running on the host while the server is running inside the WSL 2 distro, scenario expected by our OOBE. For security reasons, only localhost can connect to the server, thus this information is crucial.

That feature is enabled by default, but can be manually disabled by tweaking the ~\.wslconfig file, which is a per-user configuration file that affects all distros running in the scope of the referred Windows user.

So to be able to read that configuration value we need to:

  1. Find the user's home path;
  2. Parse the file (ini parsing has been previously implemented)
  3. look for the value of the entry [wsl2.localhostForwarding].

This will be used later in an upper level to determine whether we can run the OOBE on Windows or not.

Check the WSL docs for further information.

@CarlosNihelton CarlosNihelton marked this pull request as ready for review July 11, 2022 20:47
Copy link
Collaborator

@EduardGomezEscandell EduardGomezEscandell left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@CarlosNihelton
Copy link
Collaborator Author

Just rebased to avoid a merge conflict due #220 .

@CarlosNihelton CarlosNihelton merged commit d2d9ae9 into main Jul 12, 2022
@CarlosNihelton CarlosNihelton deleted the localhost-forwarding-deeng-295 branch July 12, 2022 14:15
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