The exact command that you need to execute, including the correct URL, is conveniently displayed on
the Jenkins slave node window just below the JNLP launch button (see Figure 11.8, “Launching a slave
via Java Web Start”).
If security is activated on your Jenkins server, Jenkins will communicate with the slave on a specific
nonstandard port. If for some reason this port is inaccessible, the slave node will fail to start and will
display an error message similar to the one shown in Figure 11.10, “The Jenkins slave failing to connect
to the master”.
Figure 11.10. The Jenkins slave failing to connect to the master
This is usually a sign that a firewall is blocking a port. By default, Jenkins picks a random port to use
for TCP communication with its slaves. However if you need to have a specific port that your firewall
will authorize, you can force Jenkins to use a fixed port in the System configuration screen by selecting
Fixed in the “TCP port for JNLP slave agents” option, as shown in Figure 11.11, “Configuring the
Jenkins slave port”.
Figure 11.11. Configuring the Jenkins slave port
11.3.3. Installing a Jenkins Slave as a Windows Service
Once you have the slave up and running on your Windows machine, you can save yourself the bother of
having to restart it manually each time your machine reboots by installing it as a Windows service. To
do this, select the “Install as Windows Service” menu option in the File menu of the slave agent window
(see Figure 11.12, “Installing the Jenkins slave as a Windows service”).