self hosted runner windows service not starting

Hi I followed the docs and I was able to add a windows self-hosted runner to github actions however I can not make the Service Work. no matter what I do it says Service is stopped.

PS C:\Users\jenkins\actions-runner> Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/actions-runner-win-x64-2.169.1.zip", “$PWD”)
PS C:\Users\jenkins\actions-runner> ./config.cmd --url https://github.com/kubernetes/minikube --token ********


| ____ _ _ _ _ _ _ _ _ |
| / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ |
| | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ | '_ / __| |
| | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | __ \ |
| ____|_|__|_| |_|__,_|_.__/ /_/ ____|__|_|___/|_| |_|___/ |
| |
| Self-hosted runner registration |

Authentication

√ Connected to GitHub

Runner Registration

Enter the name of runner: [press Enter for mini-test-2] windows-1

This runner will have the following labels: ‘self-hosted’, ‘Windows’, ‘X64’
Enter any additional labels (ex. label-1,label-2): [press Enter to skip] powershell,docker

√ Runner successfully added
√ Runner connection is good

Runner settings

Enter name of work folder: [press Enter for _work]

√ Settings Saved.

Would you like to run the runner as service? (Y/N) [press Enter for N] y
User account to use for the service [press Enter for NT AUTHORITY\NETWORK SERVICE]
Granting file permissions to ‘NT AUTHORITY\NETWORK SERVICE’.
Service actions.runner.kubernetes-minikube.windows-1 successfully installed
Service actions.runner.kubernetes-minikube.windows-1 successfully set recovery option
Service actions.runner.kubernetes-minikube.windows-1 successfully set to delayed auto start
Service actions.runner.kubernetes-minikube.windows-1 successfully configured
Waiting for service to start…
Service actions.runner.kubernetes-minikube.windows-1 started successfully
PS C:\Users\jenkins\actions-runner> Get-Service “actions.runner.*”

Status Name DisplayName


Stopped actions.runner… GitHub Actions Runner (kubernetes-m…

PS C:\Users\jenkins\actions-runner> Get-Service “actions.runner.kubernetes-minikube.windows-1”

Status Name DisplayName


Stopped actions.runner… GitHub Actions Runner (kubernetes-m…

PS C:\Users\jenkins\actions-runner> Get-Service “actions.runner.kubernetes-minikube.windows-2”
Get-Service : Cannot find any service with service name ‘actions.runner.kubernetes-minikube.windows-2’.
At line:1 char:1

  • Get-Service “actions.runner.kubernetes-minikube.windows-2”
  • CategoryInfo : ObjectNotFound: (actions.runner…ikube.windows-2:String) [Get-Service], ServiceCommand
    Exception
  • FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand

PS C:\Users\jenkins\actions-runner> Get-Service “actions.runner.kubernetes-minikube.windows-1”

Status Name DisplayName


Stopped actions.runner… GitHub Actions Runner (kubernetes-m…

PS C:\Users\jenkins\actions-runner> Start-Service “actions.runner.*”
PS C:\Users\jenkins\actions-runner> Get-Service “actions.runner.kubernetes-minikube.windows-1”

Status Name DisplayName


Stopped actions.runner… GitHub Actions Runner (kubernetes-m…

@medyagh ,

After having installed the runner application as a service, did you try the below ways to start the service?

1) Open PowerShell with administrator privileges, then execute the Start-Service  command to start the service.

Start-Service "actions.runner.*"

OR

Start-Service "actions.runner.kubernetes-minikube.windows-1"

2) Manually start the service on the Windows machine.

If above ways can’t start the service, please check if have some error/warning messges returned when you try to start the service.

I noticed you selected Y (YES) for the question “Would you like to run the runner as service? (Y/N) [press Enter for N]” when installing the runner. Typically, after we select YES  and press ENTER for “User account to use for the service [press Enter for NT AUTHORITY\NETWORK SERVICE]”, the runner will be installed as service, then system will automatically start the service.

The started services generally will not automatically stop until the machine is shut down or the someone stop the services on the machine. However, sometimes the services may be blocked by some 3rd-party softwares (such as antivirus softwares).

hi, I did all of that, and nothing works !

so if I follow the docs that wont work and no matter how many times I run the service it will still show stopped.

but however I found a way to fix it

./config.cmd --url https://github.com/kubernetes/minikube --token************* --replace --runasservice --unattended --windowslogonaccount **** --windowslogonpassword ****************

however nowhere in the docs this is mentioned, that you need to pass --runasserver and also the account and password