Launching Windows Jenkins Agents without JNLP Launching Windows Jenkins Agents without JNLP jenkins jenkins

Launching Windows Jenkins Agents without JNLP


There are several ways to implement this but since this is a windows server you can follow steps on https://github.com/kohsuke/winsw/blob/master/doc/installation.md#winsw-installation-guide to install jenkins slave as service without javaws.


I believe @Mike was referring to: Install Slave as a Windows service (cmd version), which does not need JNLP/javaws.

OR, under Jenkins 2 (we are using 2.121.1 plus WMI Windows Agents (aka windows-slaves:1.4), there is now an option to "Let Jenkins control this Windows slave as a Windows service", essentially in the same fashion as a Linux node.

Jenkins Node launch config

You must have an Admin account (and password). We had to follow the guidance to edit registry when "Windows agents fail to start via DCOM" (Guidance is for Server 2012) to remotely manage the service. So far, seems to be working OK, YMMV. So far, seems to be working OK, no "subtle probelms"; YMMV.

For entries:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID{72C24DD5-D70A-438B-8A42-98424B88AFB8}
  • HKEY_CLASSES_ROOT\CLSID{76A64158-CB41-11D1-8B02-00600806D9B6}

(There are several matches for the keys; just change the two locations indicated)

  1. Launch 'regedit' (as Administrator)
  2. Find (Ctrl+F) the following registry key: "{72C24DD5-D70A-438B-8A42-98424B88AFB8}" inHKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\
  3. Right click and select 'Permissions'
  4. Change owner to administrators group (Advanced...).
  5. Change permissions for administrators group. Grant Full Control.
  6. Change owner back to TrustedInstaller (user is "NT Service\TrustedInstaller" on local machine)
  7. Repeat the steps 1-6 for HKEY_CLASSES_ROOT\CLSID{76A64158-CB41-11D1-8B02-00600806D9B6}
  8. Restart Remote Registry Service (Administrative Tools / Services)


For me the easiest and best working solution to launch Windows Jenkins Agents without JNLP was to run in the command prompt java -jar agent.jar ... command. The command parameters should be grabbed from the url of the agent:

http://your_jenkins_url/computer/your_agent_name_or_ip/

I downloaded the agent.jar on my PC, moved it to a desired directory, launched the Command Prompt from the dir where the agent.jar was moved and executed the proposed command with the appropriate parameters.

In my case:

java -jar agent.jar -jnlpUrl http://your_jenkins_url/computer/your_agent_name_or_ip/slave-agent.jnlp -secret 76986574e97c2b635c7076740dc93326eaaf5a3ad30573144915489a1ccfee44 -workDir "D:\jenkins"

This was one of the proposed approaches in the docs here - https://www.jenkins.io/doc/administration/requirements/upgrade-java-guidelines/

Java Web Start Java Web Start has been removed in Java 11. When aJenkins controller is running on Java 11, the Java Web Start buttonwill no longer appear in the Web UI. Agents for a Java 11 Jenkinsserver can’t be launched from a *.jnlp file downloaded to a webbrowser.

There are no plans to replace this functionality. Connect agents toJenkins on Java 11 with plugins like SSH Build Agents Plugin, withoperating system command line calls to java -jar agent.jar, or byusing containers.