Add support for Windows Server 2022 = Windows Server 2022 21H2 = Windows 11 21H2 = Windows 11 22H2
Overview
I confirm that Windows Server Core LTSC 2022 images work on Windows 11 so it is really/rather important (I think) that the new GitLab Runner works under 1) Windows Server 2022 and also under 2) Windows 11.
Background
At the container level, Windows Server 2022 = Windows Server 2022 21H2 = Windows 11 21H2 = Windows 11 22H2 and that the container images are compatible on these OSes and will be in the future also on the same types of new versions of these two OSes (Windows Server 2022 and Windows 11) as soon as a servercore:ltsc2022 images are used.
But, after my tests ( see here #27859 (closed) and !3218 (merged) to reply to @ratchade ), with the latest gitlab-runner 14.10.1 (f761588f), you can't invoke an LTSC 2022 docker image under Windows 11.
It's a shame because it's a problem 100% related to gitlab-runner because ALL LTSC 2022 docker images work very well and perfectly under Windows 11 in 'process isolation' mode...
Here is the error (i.e : 'normal error'):
ERROR: Job failed (system failure): prepare environment: Error response from daemon: container xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx encountered an error during hcsshim::System::Start: failure in a Windows system call: The container operating system does not match the host operating system. (0xc0370101) (exec.go:73:1s). Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
In addition there is a second problem, because it downloads a 'helper image' from win10-20H2 while it must download a 'helper image' from LTSC 2022 to work correctly...
See here (it is the 'gitlab-runner-helper' image downloaded):
registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper x86_64-f761588f-servercore20H2 5da4b9fbc70e
The solution is quite simple and easy and also rather quick (I think ?):
- allow gitlab-runner to run LTSC 2022 docker images under Windows 11,
- and of course download the correct corresponding 'helper-image' (i.e. that of LTSC 2022).
That's all, nothing else.
This solution is persistent because for the moment for Windows 11 there will not be any changes from Microsoft every 6 months at the kernel level (as this is the case with Windows 10: v1809/ltsc2019, v1903, v1909, v2004, v20H1, v20H2, ...)
You can already check for yourself that docker perfectly executes LTSC 2022 images under Windows 11 in 'process-isolation' mode (which I reported here since October).
Proposal
- Add support for Windows 11 (21H2 and 22H2)
Implementation tasks
-
Runner code update to change how the Windows OS is detected. For example: - Windows 11 (22H2) = 22621
- Windows 11 (21H2) = 22000
- Windows Server 2022 = 20348
-
... -
....