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

Allow wsl extension to install the wsl kernel package before attempting to install a distribution #3743

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

bbonaby
Copy link
Contributor

@bbonaby bbonaby commented Sep 3, 2024

Summary of the pull request

Currently the WSL extension's ability to install and register a WSL distribution relies on calling wsl.exe --install <distribution name>. Wsl.exe takes care of installing the distribution for us but we found that if the WSL kernel package isn't installed, wsl.exe (depending on the build) will just output its command line help information without installing the distribution.
See issue #3741 for how that would look. In the end our installation times out as we wait for the WSL service to register the distribution in the registry which is done through wsl.exe.

To fix this we will install the WSL kernel package from the store before starting wsl.exe --install --distribution <distribution name>. Note, in the latest builds of Windows, wsl.exe would do this for the user automatically (e.g install the kernel package from the store). However, that isn't the case in builds like Win 11 22621 or Win 11 22631 as those builds just output the help text if the kernel package isn't already installed.

In a future PR after this one we'll make it, so we do not need to call wsl.exe --install --distribution <distribution name> to install and register a distribution. That will also prevent the terminal window from popping up.

After changes: Video of me installing a distribution when the wsl kernel package is not installed. You'll see we install it from the store (its a system component), and the distribution gets installed and is registered.

Video.of.me.adding.debian.distribution.when.the.WSL.kernel.package.is.not.installed.mp4

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

@bbonaby bbonaby merged commit d64f108 into main Sep 5, 2024
4 checks passed
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.

Error creating environment [Environments reliability] WSL Creation Error: WSLInstallationFailedTimeOut
3 participants