We have already discussed Jenkins Windows slave configuration where we have seen how to configure windows slave and install windows service for the agent but sometimes due to browser issue or some unknown factors you are not getting the Jenkins File menu. It will stop you from creating windows service for this newly created Jenkins agent.
Though this popup confirms the connection has been established but there is no menu available to start this is as a service which we have seen our last article. This could be a tedious task to do since you might have tried several times on different browser but you are getting the same error. You will get the Slave connection page as below :
So, we can’t just wait for some magic to be happen, we have to manually create the window service which will allow us to manage the service from windows services and then we can stop/start/restart the Jenkins slave as and when required.
We are going to use windows service creation utility “sc” to perform this operation, as shown below :
* sc : Service Control – An utility to create, start, stop, query or delete any windows services.
C:\Jenkins>sc create binPath=ProjJenkinsSlaveStartup.bat DisplayName=JenkinsSlaveTECR
If it is throwing an error in conventional method as shown in above screenshot, we need to provide the absolute path for the command and jenkins startup batch file, so run the command as below:
C:\Jenkins>sc create jenkins binPath= "C:\Windows\System32\cmd.exe /C C:\Jenkins\ProJenkinsSlaveStartup.bat
Once you provide the accurate path and fire the command it will create a windows service for you.
Now go to Windows Settings and then to open the Windows Services and then locate the Jenkins service.
You can also see the status of the service, since it is a new service its in a stopped state and we have to start it.
Click on Start
You can now manage your Jenkins slave/agent process through windows services. It is very useful and manageable when it comes to manage the Jenkins slave on Windows machine.
Go back to your Jenkins Slave Page and now you will see that Agent is Successfully Running and ready to build your project.
You have successfully resolved the Jenkins file menu issue and created/installed windows service for your Jenkins Slave on Windows Machine.
Happy learning …..
13 thoughts on “Jenkins File menu is missing so cannot install slave as a service”
Thanks for sharing… it worked !!
Thanks Waseem for sharing your feedback
Nice article Ravi, Keep up the good work. 🙂
What is the content of ProJenkinsSlaveStartup.bat or where can I download it from?
Sorry for delay in reply.
Its just simply the java command which you get on the Jenkins node configuration page 🙂
java -jar slave.jar -jnlpUrl http://ip:port/computer/Slave/slave-agent.jnlp -secret ************
I followed the steps but then encounter an issue when starting the server that says “Windows could not start the jenkins service on Local Computer” Error 1053: The service did not respond to start or control request in a timely fashion”
Sorry for delay in reply. Couldn’t check last weekend comments.
If you are still facing the same error, then please could you let me know below and we will try to sort it out together.
– What is version of Jenkins ?
– On which step you are facing this error ?
– Did you check the Jenkins slave logs, if yes then did you find more info ?
– Are you building it under restricted firewall ?
– Do you have admin privilege on the Windows machine ?
Any other details will add more help towards it – thanks in advance
I followed the above steps but i am still getting an below issue.
“Windows could not start the jenkins service on Local Computer” Error 1053: The service did not respond to start or control request in a timely fashion”
Could you please help me to resolve this issue?
Can you please verify if the given port is occupied by any other service or not ? And the user has all the required permissions ? Firewall open ?
Also you could try with adding a register entry for HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control “ServicesPipeTimeout” with the value of 180000 ms.
Please do post Jenkins logs and other errors in case this doesn’t solve your issue
Ravi, I am also seeing the same error. I am using Jenkins version 2.222.1. I don’t see any logs in the folder where I am starting the slave. Please let me know where to check the jenkins slave log. I am able to start the batch file manual but get the error while trying to start from service.
Thanks for your query and apologies for delayed response (I was on leave)
For windows slaves, Jenkins store the slave error logs in the same folder where you have slave.jar file
Please could you check logs at : \jenkins-slave.wrapper.log and \jenkins-slave.err.log
How can I configure the startup option for jenkins slave service ? I want it to start with a list of specific labels.
Thanks for your message.
I do not understand the exact requirement, please could you elaborate with some examples?
I hope you are pointing to Node and Label parameter – please check this plugin if this is what you needed.
Also, please do refer our Jenkins Windows Slave Configuration Guide for more details
Happy questing !!