You want to connect multiple Windows slaves, each installed as a service.
- CloudBees Jenkins Enterprise
Java Web Start offers the possibility to connect multiple slaves on the same machine. In addition, it is possible to install a JNLP slave as a service in Windows. Thus, this article is aimed to explain how to install multiple Windows slaves as services.
Install Several Slaves
1) Create a slave to launch via Java Web Start
2) There are different ways to launch the slave agent:
- The easiest way is to access Jenkins from the slave machine, go to the node page
computer/<my-node>/and click on the
Launchbutton. This downloads the file
slave-agent.jnlpand runs it.
- Another way is to run the command
java -jar slave.jar -jnlpUrl http://<my-server>/computer/<my-node>/slave-agent.jnlp -secret <my-secret>described at
- You can download
slave-agent.jnlpfrom the client master, copy it to the slave machine and run
3) Once the slave is launched, you should see a popup in Windows. To install this slave as a service, click on
File/Install as a service.
5) The service appears in the services popup. (run
servcies.msc to see windows services). You can double click on the service to show its name:
6) All slaves are installed with the same service display name in Windows: “Jenkins Slave”. In order to be able to install several slaves, the
displayname needs to be modified. Run the following command as an administrator to change the display name of the service.
$ sc config
7) For each slave you want to add and install as a service, reproduce steps 1 to 6.
Configure Slave User
Although it is recommended to run master/slaves with a single jenkins user, it is possible to run each slave as a different user. This can be configured in the slave service properties, in the logon tab. For example, the following slave is run with the user
Further documentation can be found on the wiki regarding Windows slave.