actions / runner-images

GitHub Actions runner images
MIT License
9.17k stars 2.84k forks source link

Add WSL2 to the Windows 2022 image #5920

Closed nzbr closed 1 year ago

nzbr commented 1 year ago

Tool name

Windows Subsystem for Linux version 2

Tool license

Proprietary (included with Windows)

Add or 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

Virtual environments where you need the tool

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 commented 1 year ago

https://github.com/actions/virtual-environments/issues/5760#issuecomment-1157585475

nzbr commented 5 months ago

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 commented 5 months ago

@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 commented 2 weeks ago

@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/