How to install Jenkins on Windows Server 2012

13

1

This may sound like a trivial question but here is what is happening:

  1. I grab the latest version of Jenkins as native installer for Windows (1.491 in my case)
  2. I set up a Windows Server 2012 (official release image, no release candidate) and install all updates
  3. I try to run the Jenkins installation.

Everything is working fine in the installation process except for the part where it tries to start the service. At this point I get informed that I have not sufficient privileges to start system services. This has been working on 2k8R2 without any problems. I am logged on as Administrator which was created during server installation and is the only user on the machine.

The full message I get is:

Service 'Jenkins' (Jenkins) failed to start. Verify that you have sufficient privileges to start system services.

Is anybody else having these problems? I guess the internals of Server 2012 have changed the way of the installation and the Jenkins installer is not build for that.

If anyone can tell me to which group I have to add the administrator, or can give me a work-around for this problem, this will help a lot.

HaMster

Posted 2012-11-26T08:39:21.910

Reputation: 291

Answers

13

You need to install .net 3.5 (Even if you have .net 4+ installed)

You do this through the Server Manager:

  • Configure local server
  • Add roles and features
  • Click next until you get to the features section
  • Check the .net 3.5 check box (I also checked the sub items for good measure)
  • If you get a warning about needing to Specify an alternate path, then:
    • Insert your windows installation media.
    • Click Specify an alternate source path
    • Put D:\sources\sxs in the path field (click Ok)
  • Click Install

Once you have done this you should be able to install Jenkins through the msi installer. It will be able to successfully start the Jenkins service now.

I think Jenkins tries to install .net 3.5, but because the install media was 'missing' it hangs (as it is running in the background) and that is why it actually times out

DarcyThomas

Posted 2012-11-26T08:39:21.910

Reputation: 275

I don't know why, but the .NET Framework 3.5 seems to be the only requirement missing... Thank you for this hint, that is fixing the original problem – HaMster – 2012-11-29T12:06:19.273

3

I've done it finally!

Not only did I need to install .NET 3.5 (Thankyou DarcyThomas) but I also found out that I needed to add a configuration file to the installation directory as well.

Add a file called jenkins.exe.config with the following contents to the installation directory:

<configuration> 
  <runtime> 
     <generatePublisherEvidence enabled="false"/> 
  </runtime> 
</configuration> 

It turns out that when starting the service, Windows tries to hit the internet to download a certificate to confirm the signer of the executable. So in my case where the server does not have internet access, it fails. I found the solution here.

I hope this saves everyone else the hours of pain I've just been through. Cheers.

Ben Cull

Posted 2012-11-26T08:39:21.910

Reputation: 131

Wich edition of Windows Server 2012 were you running? I never had to do that on my Standard edition. – HaMster – 2013-02-04T14:27:55.273

Windows Server 2012 Datacentre - Although I thought it was mainly our network architecture that broke things rather than the edition itself. – Ben Cull – 2013-02-06T01:36:58.213

2

I found a solution based on this answer by Jan The issue is that Windows is looking for the certificate for the service and your server does not have access to the Internet. Your best option is to enable Internet access to the server for the installation of Jenkins. You wont need it once Jenkins is installed.

You could also try to disable certificate checking this way (though I'm unsure if this will work.)

1) Create the directory: C:\Program Files (x86)\Jenkins

2) Create a text file named jenkins.exe.config

3) Add the following text to the text file:

<configuration> 
  <runtime> 
     <generatePublisherEvidence enabled="false"/> 
  </runtime> 
</configuration>

4) Run setup as an Administrator

Serj Sagan

Posted 2012-11-26T08:39:21.910

Reputation: 131

You really shouldn't post links, how about just copy-and-paste your other answer here? – BenjiWiebe – 2013-02-21T16:57:00.013

Ok... this is done – Serj Sagan – 2013-02-21T17:37:49.973

2Copy/paste answers are generally discouraged if they're not sourced/cited properly (it falls under plagiarism). – ashes999 – 2013-05-14T13:47:38.243

0

Create a Windows scheduled task that is executed once Windows starts only, instead. Under some distributions of Windows, running Jenkins as a service simply does not work out of the box. This approach is a hack, but it works. I've used it across multiple Windows nodes.

I personally think that the Jenkins docs on Windows need some more polishing in this regard. Perhaps a bit more work on this as well...

I hope this helps.

carlspring

Posted 2012-11-26T08:39:21.910

Reputation: 140

I thought of the same thing and I do handle it this way now. However I want to give some guys new to the topic a quick intro and it would be nice if Jenkins was working. I guess I'm going to make them aware of this issue or get involved myself. But thank you for the hint. – HaMster – 2012-11-26T10:19:51.213

Please, write back, if a better solution is found, or if you finally get them to fix this. I had to live with this for over two years at my previous job and it was annoying. The JNLP installer doesn't really work out of the box in a lot of cases (this being one of them). I think that instead of them trying to use the stupid DLL-s of Windows, they should like... invoke a command-line script that either adds it as a service, or creates a scheduled job. I believe this should be fairly easy. – carlspring – 2012-11-26T10:26:21.207

I never had any problems with the native installer on windows that is provided on the download board at Jenkins-Homepage. The first time I haven't finished the installation successfully was in the case described above, even if I gave it several tries with different scenarios. So as I said I guess this is a Server 2012 specific problem

– HaMster – 2012-11-26T11:52:42.957

Oh, I've seen this on Windows Server 2008 every time. For sure. – carlspring – 2012-11-26T12:10:24.280

It's a Windows Server not having Internet access issue – Serj Sagan – 2013-02-21T16:35:05.170