Skip to content

[windows] Add windows-11-arm64 image generation code#13879

Open
shamil-mubarakshin wants to merge 50 commits intoactions:mainfrom
shamil-mubarakshin:shamilm/add-win11-arm-vs2026
Open

[windows] Add windows-11-arm64 image generation code#13879
shamil-mubarakshin wants to merge 50 commits intoactions:mainfrom
shamil-mubarakshin:shamilm/add-win11-arm-vs2026

Conversation

@shamil-mubarakshin
Copy link
Copy Markdown
Contributor

Description

This PR:

  • adds template and toolset files for windows 11 arm64 with VS2022 and VS2026
  • updates existing code to support new images

Related issue: https://github.com/github/hosted-runners-images/issues/608

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

Copilot AI review requested due to automatic review settings April 2, 2026 15:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Packer/template and toolset support to generate new Windows 11 ARM64 runner images (including a VS2026 variant), and updates Windows build/tests/docs-gen scripts to handle Windows 11 and ARM64-specific differences.

Changes:

  • Add new Windows 11 ARM64 toolset definitions and Packer build templates (base + VS2026).
  • Introduce OS/arch detection helpers (Test-IsWin11, Test-IsArm64) and update installers to download/install ARM64-compatible binaries where needed.
  • Adjust Pester tests and software-report generation to skip/omit components not present on Windows 11 images.

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
images/windows/toolsets/toolset-win-11-vs2026-arm64.json New toolset definition for Windows 11 ARM64 with VS2026.
images/windows/toolsets/toolset-win-11-arm64.json New toolset definition for Windows 11 ARM64 with VS2022.
images/windows/templates/locals.windows.pkr.hcl Register new Windows 11 ARM64 image variants and source SKUs/disk sizing.
images/windows/templates/build.windows-11-vs2026-arm64.pkr.hcl New Packer build pipeline for Windows 11 ARM64 + VS2026.
images/windows/templates/build.windows-11-arm64.pkr.hcl New Packer build pipeline for Windows 11 ARM64 (VS2022).
images/windows/scripts/tests/Wix.Tests.ps1 Skip WiX validation on Windows 11.
images/windows/scripts/tests/WindowsFeatures.Tests.ps1 Adjust update expectations; skip WSL2 checks on Windows 11.
images/windows/scripts/tests/VisualStudio.Tests.ps1 Skip Windows 10 SDK validation on Windows 11.
images/windows/scripts/tests/Toolset.Tests.ps1 Remove PyPy tool executable checks on Windows 11.
images/windows/scripts/tests/Tools.Tests.ps1 Skip Service Fabric/Zstd on Windows 11; add CMake/Ninja functional tests.
images/windows/scripts/tests/Shell.Tests.ps1 Skip MSYS2 shell wrapper validation on Windows 11.
images/windows/scripts/tests/MSYS2.Tests.ps1 Skip MSYS2 package validation on Windows 11.
images/windows/scripts/tests/Miniconda.Tests.ps1 Skip Miniconda validation on Windows 11.
images/windows/scripts/tests/Java.Tests.ps1 Make JAVA_HOME env var expectations architecture-aware (X64 vs AARCH64).
images/windows/scripts/tests/Haskell.Tests.ps1 Skip Haskell validation on Windows 11 and prevent discovery-time failures.
images/windows/scripts/tests/Docker.Tests.ps1 Skip Docker validations on Windows 11.
images/windows/scripts/tests/Databases.Tests.ps1 Skip MongoDB/PostgreSQL validations on Windows 11.
images/windows/scripts/tests/ChocoPackages.Tests.ps1 Skip SVN on Windows 11; skip CMake/Ninja choco checks on ARM64.
images/windows/scripts/tests/Android.Tests.ps1 Skip Android SDK validation on Windows 11.
images/windows/scripts/helpers/VisualStudioHelpers.ps1 Add Visual Studio installer architecture parameter support.
images/windows/scripts/helpers/InstallHelpers.ps1 Add Test-IsArm64 and Test-IsWin11 helper functions.
images/windows/scripts/helpers/ImageHelpers.psm1 Export new helper functions via module.
images/windows/scripts/docs-gen/SoftwareReport.Java.psm1 Make Java software report arch-aware for JAVA_HOME_* variables.
images/windows/scripts/docs-gen/SoftwareReport.Common.psm1 Omit CONDA env var from report on Windows 11.
images/windows/scripts/docs-gen/SoftwareReport.CachedTools.psm1 Conditionally omit PyPy cached tool reporting on Windows 11.
images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 Omit multiple tool/report sections on Windows 11.
images/windows/scripts/build/Install-WDK.ps1 Add Windows 11 WDK URL path.
images/windows/scripts/build/Install-VisualStudio.ps1 Pass architecture into Visual Studio installer flow.
images/windows/scripts/build/Install-Rust.ps1 Make Rust bootstrap arch-aware; adjust tool installs based on OS.
images/windows/scripts/build/Install-Ruby.ps1 Make Ruby installer selection arch-aware and pass toolcache arch.
images/windows/scripts/build/Install-R.ps1 Adjust R path resolution for ARM64 environments.
images/windows/scripts/build/Install-PowershellCore.ps1 Download PowerShell MSI matching detected arch.
images/windows/scripts/build/Install-OpenSSL.ps1 Choose OpenSSL arch parameter based on ARM64 detection.
images/windows/scripts/build/Install-NodeJS.ps1 Download Node MSI matching detected arch.
images/windows/scripts/build/Install-Ninja.ps1 New ARM64-only Ninja install implementation.
images/windows/scripts/build/Install-Nginx.ps1 Avoid failing when w3svc service doesn’t exist.
images/windows/scripts/build/Install-NativeImages.ps1 Skip NGen update on Windows 11.
images/windows/scripts/build/Install-LLVM.ps1 Add ARM64 LLVM install via GitHub release archive.
images/windows/scripts/build/Install-JavaTools.ps1 Install and set JAVA_HOME env vars based on architecture.
images/windows/scripts/build/Install-GitHub-CLI.ps1 Download GitHub CLI installer matching arch.
images/windows/scripts/build/Install-Git.ps1 Download Git for Windows installer matching arch.
images/windows/scripts/build/Install-Firefox.ps1 Download Firefox and geckodriver matching arch.
images/windows/scripts/build/Install-EdgeDriver.ps1 Download Edge WebDriver matching arch.
images/windows/scripts/build/Install-DotnetSDK.ps1 Validate SDK archive hash by arch; apply manifest workaround unconditionally.
images/windows/scripts/build/Install-CMake.ps1 New ARM64-only CMake install implementation with checksum validation.
images/windows/scripts/build/Install-Chrome.ps1 Download Chrome installer matching arch.
images/windows/scripts/build/Install-Apache.ps1 Avoid failing when w3svc service doesn’t exist.
images/windows/scripts/build/Configure-User.ps1 Skip TortoiseSVN-related config on Windows 11 (and Win25).
images/windows/scripts/build/Configure-Toolset.ps1 Make Go env var naming arch-aware (X64 vs AARCH64).
images/windows/scripts/build/Configure-Shell.ps1 Don’t create MSYS2 bash wrapper on Windows 11.
images/windows/scripts/build/Configure-ImageDataFile.ps1 Add Windows 11 ARM64 image label/URLs to imagedata metadata.
images/windows/scripts/build/Configure-BaseImage.ps1 Avoid failing when ServerManager scheduled task isn’t present.

@actions actions deleted a comment from doni108-bot Apr 2, 2026
@actions actions deleted a comment from doni108-bot Apr 2, 2026

Write-Host "Disable Server Manager on Logon"
Get-ScheduledTask -TaskName ServerManager | Disable-ScheduledTask
Get-ScheduledTask -TaskName ServerManager -ErrorAction SilentlyContinue | Disable-ScheduledTask
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious why it is not required for arm64.
I wonder if we want to wrap it to Test-IsArm64 instead of silentlyContinue to avoid problems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remote Access Management Tools optional feature is not enabled on windows-11

New-Item -Path $shellPath -ItemType Directory | Out-Null

# add a wrapper for C:\msys64\usr\bin\bash.exe
if (-not (Test-IsWin11)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be -not (Test-IsArm64) or Test-IsX64

Comment on lines +30 to +34
} elseif ((Test-IsWin11) -and (Test-IsArm64) -and $env:INSTALL_VS_2026) {
$imageLabel = "windows-11-vs2026-arm64"
$softwareUrl = "${githubUrl}/win11-vs2026-arm64/$imageMajorVersion.$imageMinorVersion/images/windows/Windows11-VS2026-Arm64-Readme.md"
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win11-vs2026-arm64%2F$imageMajorVersion.$imageMinorVersion"
} elseif ((Test-IsWin11) -and (Test-IsArm64)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider changing helpers to include architecture:

  • rename Test-IsWin25 to Test-IsWin25-X64
  • rename Test-IsWin22 to Test-IsWin22-X64
  • rename Test-IsWin11 to Test-IsWin11-Arm64
  • add helper Test-IsX64

# TortoiseSVN not installed on Windows 2025 image due to Sysprep issues
if (-not (Test-IsWin25)) {
# TortoiseSVN not installed on Windows 2025 and Windows 11 due to Sysprep issues
if (-not (Test-IsWin25) -and -not (Test-IsWin11)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to avoid extending this condition every time when add a new image

Suggested change
if (-not (Test-IsWin25) -and -not (Test-IsWin11)) {
if (Test-IsWin22) {

Comment on lines +7 to +9
if (-not (Test-IsArm64)) {
exit 0
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we just not add it to x64 template? If we keep it as it is, it could be very confusing. packer logs will show that script is completed.

binGhcPath = $binGhcPath
Describe "Haskell" -Skip:(Test-IsWin11) {
BeforeDiscovery {
if (Test-IsWin11) { return }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious why do we need this line if we skip test completely?

}

It "Make a simple ninja project" {
"cmake -GNinja $ninjaProjectPath" | Should -ReturnZeroExitCode
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: add spaces

Comment on lines +22 to +24
if (Test-IsWin11) {
$toolsExecutables.Remove("PyPy")
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

may be add if x64 to improve readability?

$toolsExecutables = @{
    Python = @(
        @{ Binary = "python.exe"; Arguments = "--version" },
        @{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
    )
    Node = @(
        @{ Binary = "node.exe"; Arguments = "--version" },
        @{ Binary = "npm"; Arguments = "--version" }
    )
    Go = @(
        @{ Binary = "bin\go.exe"; Arguments = "version" }
    )
    Ruby = @(
        @{ Binary = "bin\ruby.exe"; Arguments = "--version" }
    )
}
if (Test-IsX64) {
    $toolsExecutables.Add("PyPy", @(
        @{ Binary = "python.exe"; Arguments = "--version" },
        @{ Binary = "Scripts\pip.exe"; Arguments = "--version" }
    ))
}

Comment on lines +56 to +58
"Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name AutoAdminLogon -Value 1 -type String",
"Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultUsername -Value \"${var.install_user}\" -type String",
"Set-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultPassword -Value \"${var.install_password}\" -type String",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you please add comments with explanation why do we need these lines?

Comment on lines +208 to +210
"Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name AutoAdminLogon",
"Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultUsername",
"Remove-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon' -Name DefaultPassword",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you please add comment with explanation why do we need it?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants