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

fix: wsl2 detection #981

Merged
merged 2 commits into from Dec 7, 2022
Merged

Conversation

evidolob
Copy link
Contributor

@evidolob evidolob commented Dec 6, 2022

What does this PR do?

It change the way of WSL2, as suggested in #857 (comment) I try to use wsl --set-default-version 2 as command which ensures that user has wsl2 installed and it has permission to use it.

Screenshot/screencast of this PR

n/a

What issues does this PR fix or reference?

resolve #857

How to test this PR?

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
Co-authored-by: Florent BENOIT <fbenoit@redhat.com>
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@benoitf
Copy link
Collaborator

benoitf commented Dec 6, 2022

it's not an issue to set WSL to 2 as a check if the user is using WSL1 (and do not want to set WSL2) or it'll just call a prompt ?

@evidolob
Copy link
Contributor Author

evidolob commented Dec 7, 2022

Hmm, that is good point.
In other hand, podman CLI check wsl installation with wsl --status https://github.com/containers/podman/blob/main/pkg/machine/wsl/machine.go#L1147
and also validates WSL feature with switching to wsl2: https://github.com/containers/podman/blob/main/pkg/machine/wsl/machine.go#L1173-L1175

So even if we don’t use switching to wsl2, podman CLI will do.

@benoitf
Copy link
Collaborator

benoitf commented Dec 7, 2022

image

Copy link
Collaborator

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

tested, worked on Windows 11 (French)

@evidolob evidolob merged commit c6d09a0 into containers:main Dec 7, 2022
@evidolob evidolob deleted the fix-wsl2-detection branch December 7, 2022 08:09
@podman-desktop-bot podman-desktop-bot added this to the 0.11.0 milestone Dec 7, 2022
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.

[0.9.1] Windows 10 WSL2 installation not detected
3 participants