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

Add WSL2 to the Windows 2022 image #5920

Closed
3 of 12 tasks
nzbr opened this issue Jul 17, 2022 · 6 comments
Closed
3 of 12 tasks

Add WSL2 to the Windows 2022 image #5920

nzbr opened this issue Jul 17, 2022 · 6 comments

Comments

@nzbr
Copy link

nzbr commented Jul 17, 2022

Tool name

Windows Subsystem for Linux version 2

Tool license

Proprietary (included with Windows)

Add or update?

  • Add
  • Update

Desired version

2

Approximate size

No response

Brief description of tool

WSL2 allows running Linux applications on windows by using a Hyper-V VM running a real Linux kernel

URL for tool's homepage

https://docs.microsoft.com/en-us/windows/wsl/about

Provide a basic test case to validate the tool's functionality.

Describe "WSL2" {
  It "should be possible to install a wsl2 distro and run commands in it" {
    wsl --install -d Ubuntu
    wsl -d Ubuntu echo works | Should -Match "works"
  }
}

Platforms where you need the tool

  • Azure DevOps
  • GitHub Actions

Virtual environments where you need the tool

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 10.15
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Can this tool be installed during the build?

Installing WSL2 during the build is not possible due to the fact that enabling the required Windows features requires a reboot

Tool installation time in runtime

No response

Are you willing to submit a PR?

Yes

@al-cheb
Copy link
Contributor

al-cheb commented Jul 17, 2022

#5760 (comment)

@nzbr
Copy link
Author

nzbr commented Nov 30, 2023

Given that hosted runners do seem to support nested virtualization now, is it conceivable that WSL2 will be enabled on windows runners in the future?

@mikhailkoliada
Copy link
Contributor

@nzbr only larger runners officially support nested now, not the standard ones, unfortunately (yet), so we can not replace v1 with v2 for the time being. Eventually nested will be supported by the standard runners as well, but we have no ETA on this.

@wmmc88
Copy link

wmmc88 commented May 1, 2024

@mikhailkoliada According to https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#cloud-hosts-used-by-github-hosted-runners it seems like the standard runners are now using Dadsv5 which supports nested virtualization. Does this mean WSL2 can be used in github-hosted windows runners now?

Searching around seems to show that the change to the new VMs happened in January: https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/

@ssbarnea
Copy link

ssbarnea commented Sep 2, 2024

@mikhailkoliada Any updates or hints on how to make WSL2 work in 2024? We cannot really use WSL1 because we need to make use of docker/podman from inside WSL.

When we are on larger runners, we could attempt to upgrade wsl version from inside the pipeline but I am not sure how long it will take to perform this action as it could easily double the execution time for the pipelines.

@vedantmgoyal9
Copy link

I got WSL2 working in GitHub runners. See https://github.com/vedantmgoyal9/setup-wsl2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants