Make sure to restrict the
Write
permissions on the GitLab Runner directory and executable.
If you do not set these permissions, regular users can replace the executable with their own and run arbitrary code with elevated privileges.
Install GitLab Runner as a service and start it. You can either run the service
using the Built-in System Account (recommended) or using a user account.
Run service using Built-in System Account
(under directory created in step 1. from above, ex.:
C:\GitLab-Runner
)
See the troubleshooting section if you encounter any
errors during the GitLab Runner installation.
(Optional) Update the runner’s
concurrent
value in
C:\GitLab-Runner\config.toml
to allow multiple concurrent jobs as detailed in
advanced configuration details
.
Additionally, you can use the advanced configuration details to update your
shell executor to use Bash or PowerShell rather than Batch.
Voila! Runner is installed, running, and will start again after each system reboot.
Logs are stored in Windows Event Log.
This means that we support:
Long-Term Servicing Channel,
versions for 5 years after their release date. Note that we don’t
support versions that are on extended support.
Semi-Annual Channel
versions for 18 months after their release date. We don’t support
these versions after mainstream support ends.
The Docker executor for Windows containers has strict version
requirements, because containers have to match the version of the host
OS. See the list of supported Windows containers
for more information.
After a Windows version no longer receives mainstream support from
Microsoft, we officially deprecate the version and
remove it in the next major change. For example, in 12.x we started
supporting Windows 1803
because it came out on 2018-04-30. Mainstream support ended on
2019-11-12, so we deprecated Windows 1803 in 12.x and it was
removed in
GitLab 13.0.
Below is a list of versions that are commonly used and their end of life
date:
Mainstream support end of life date
Windows 10 1809/2019
January 2024
Windows Server Datacenter 1809/2019
January 2024
Windows Server Datacenter 1903
December 2020
GitLab aims to test and release new GitLab Runner helper images that
include the latest Windows Server version (Semi-Annual Channel) within 1
month of the official Microsoft release date on the Google Cloud Platform. Refer to the
Windows Server current versions by servicing option list
for availability dates.
If you encounter a The service did not start due to a logon failure error
while starting the service, please look in the FAQ to check how to resolve the problem.
If you don’t have a Windows Password, the GitLab Runner service won’t start but you can
use the Built-in System Account.
PS C:\> Get-WinEvent -ProviderName gitlab-runner
ProviderName: gitlab-runner
TimeCreated Id LevelDisplayName Message
------------------------------------
2/4/2021 6:20:14 AM 1 Information [session_server].listen_address not defined, session endpoints disabled builds=0...
2/4/2021 6:20:14 AM 1 Information listen_address not defined, metrics & debug endpoints disabled builds=0...
2/4/2021 6:20:14 AM 1 Information Configuration loaded builds=0...
2/4/2021 6:20:14 AM 1 Information Starting multi-runner from C:\config.toml... builds=0...
I get a PathTooLongException during my builds on Windows
The NTFSSecurity PowerShell module provides
a Remove-Item2 method which supports long paths. GitLab Runner will
detect it if it is available and automatically make use of it.
I can’t run Windows BASH scripts; I’m getting The system cannot find the batch label specified - buildscript
If your program is doing the above, then you need to disable that conversion for the CI builds so that the ANSI codes remain in the string.
See GitLab CI YAML docs
for an example using PowerShell and issue #332
for more information.
The service did not start due to a logon failure error when starting service
According to Microsoft’s documentation
this should work for: Windows Vista, Windows Server 2008, Windows 7, Windows 8.1,
Windows Server 2008 R2, Windows Server 2012 R2, Windows Server 2012, and Windows 8.
The Local Security Policy tool may be not available in some
Windows versions - for example in “Home Edition” variant of each version.
After adding the SeServiceLogonRight for the user used in service configuration,
the command gitlab-runner start should finish without failures
and the service should be started properly.