Windows 7 Agents (slaves) via SSH

96 views
Skip to first unread message

Steve K

unread,
Jul 25, 2019, 5:55:00 PM7/25/19
to Jenkins Users
Hello,

Has anyone successfully implemented the use of SSH to launch Windows 7 agents (slaves)?
I have been attempting to setup OpenSSH, but I'm falling short of getting it working.
For one thing, the sshd never shows up as one of my Services, even though I believe I've followed the steps necessary to register the service.
If I attempt to launch sshd manually, I get ACCESS DENIED, even though I can successfully launch ssh-agent.

We have been happily using JNLP for our Windows agents, but, as we deploy Java 11 on our slaves, the JNLP method is no longer available.

Please share any tips and tricks you may have needed to employ to make the SSH slaves work as expected.

Thanks in advance.

Steve K.

Mark Waite

unread,
Jul 25, 2019, 6:07:51 PM7/25/19
to Jenkins Users
On Thu, Jul 25, 2019 at 3:55 PM Steve K <Steve.K...@carestream.com> wrote:
Hello,

Has anyone successfully implemented the use of SSH to launch Windows 7 agents (slaves)?
I have been attempting to setup OpenSSH, but I'm falling short of getting it working.
For one thing, the sshd never shows up as one of my Services, even though I believe I've followed the steps necessary to register the service.
If I attempt to launch sshd manually, I get ACCESS DENIED, even though I can successfully launch ssh-agent.


I would not expect OpenSSH server to ever work with Windows 7.  It doesn't work with the original releases of Windows 10.  Microsoft didn't make OpenSSH server available until a relatively recent Windows 10 service pack.  It has been working quite well for me from the Windows 10 service pack on the 3 or 4 Windows 10 machines that I run.
 
We have been happily using JNLP for our Windows agents, but, as we deploy Java 11 on our slaves, the JNLP method is no longer available.

Since you were using JNLP from a web browser previously, I assume that means you were launching from a desktop login.  If you're launching from a desktop login, then you can launch the agent with a batch file instead of using JNLP.  That works with Java 11.

Don't forget that the Java version running the agent process must be the same major Java version as the Java version running the master.  If you're running Java 11 on your master, you need to run Java 11 on the agent.  If you're running Java 8 on the master, you need to run Java 8 on the agents.
 

Please share any tips and tricks you may have needed to employ to make the SSH slaves work as expected.

Thanks in advance.

Steve K.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1298b6db-6dd5-4226-8d0e-f394e50e3077%40googlegroups.com.


--
Thanks!
Mark Waite

Steve K

unread,
Jul 29, 2019, 2:26:42 PM7/29/19
to Jenkins Users
Thanks Mark,
Web articles, such as this "Installing OpenSSH on Windows 7" gave me hope of finding a workable solution.
I had also considered trying to use Cygwin, as described by Kohsuke Kawaguci in the Wiki page "SSH slaves and Cygwin", but that seemed like too much overhead when several slaves/agents need to be configured.

Launching an agent with a batch file seems like a good alternative. Have you been able to auto-start such a script (for example, to run at boot time)?

Thanks again.

Mark Waite

unread,
Jul 29, 2019, 2:32:27 PM7/29/19
to Jenkins Users
I have a batch file on the Desktop of the computer with a link to that Desktop batch file in the Startup folder for the specific user.  The specific user is configured to auto-login.  Thus, those machines run the agent automatically when they boot.

Running from a running Desktop account also assures that desktop access is available (for things like Selenium tests).
 
Thanks again.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Steve K

unread,
Jul 29, 2019, 4:19:54 PM7/29/19
to Jenkins Users
Thanks again Mark.

So, what does the master think the launch method is for the slave? 

Mark Waite

unread,
Jul 29, 2019, 7:45:35 PM7/29/19
to Jenkins Users
Launch method is "Launch agent by connecting it to the master" with Jenkins LTS 2.176.1 and later.

Agent-launch-method-2.176.png

Launch method is "Launch agent via Java Web Start" with Jenkins LTS 2.164.3 and earlier.

Agent-launch-method-2.164.png

"Java Web Start" was a misleading description of that launch method, since the agent configured with that launch method could be started with Java Web Start (if using Java 8) or from a command line (with either Java 8 or Java 11).  That misleading description was fixed in time for the 2.176.1 LTS.


On Mon, Jul 29, 2019 at 2:20 PM Steve K <Steve.K...@carestream.com> wrote:
Thanks again Mark.

So, what does the master think the launch method is for the slave? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.


--
Thanks!
Mark Waite

Steve K

unread,
Jul 30, 2019, 1:39:42 PM7/30/19
to Jenkins Users

Thanks once again Mark.
May I bug you for some more info?  I was really hoping to answer this on my own, but I feel like I'm chasing my tail.  Whenever I do searches for Jenkins agent launch methods, I'm predominantly directed to a description of JNLP usage or, to a lesser extent, SSH; neither of which I want for the Win 7 machines.
Could you please provide a sample script that you leverage?
That would be greatly appreciated! 

Slide

unread,
Jul 30, 2019, 1:46:12 PM7/30/19
to Jenkins User Mailing List
The Chocolatey package for OpenSSH says that it should work on Windows 7 64-bit. I may have missed an earlier email, are your systems 32 or 64-bit systems?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Steve K

unread,
Jul 30, 2019, 4:26:20 PM7/30/19
to Jenkins Users

Win 7 64 bit.

Mark Waite

unread,
Jul 30, 2019, 6:35:27 PM7/30/19
to Jenkins Users
I launch my Windows 10 ssh agents using the instructions from the ssh-slaves plugin page:


They use the Microsoft OpenSSH server on Windows 10.

I launch JNLP Windows agents with the following batch script:

@ECHO ON
CD %HOME%\bin
CALL clean-temp-dirs
CD %TEMP%
RMDIR /S/Q .
C:
CD C:\J
ROBOCOPY %HOME%\bin . agent.jar
SET JAVA_HOME=C:\Users\MarkE\tools\jdk8u222-b10
SET PATH=%JAVA_HOME%\bin;%PATH%
set SECRET=the-secret-has-been-removed-for-this-email
    java -jar agent.jar -jnlpUrl http://mark-pc2.markwaite.net:8080/computer/cb-pc/slave-agent.jnlp -secret %SECRET%


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/68d09b75-bd6f-4ec8-afdf-000efe443fdb%40googlegroups.com.


--
Thanks!
Mark Waite

Mark Waite

unread,
Jul 30, 2019, 6:37:11 PM7/30/19
to Jenkins Users
On Tue, Jul 30, 2019 at 4:35 PM Mark Waite <mark.ea...@gmail.com> wrote:
I launch my Windows 10 ssh agents using the instructions from the ssh-slaves plugin page:


They use the Microsoft OpenSSH server on Windows 10.

I launch JNLP Windows agents with the following batch script:

I launch Windows agents from the Windows Desktop (calling them JNLP in that case seems like a misnomer).  They are not using "Java Web Start" to launch.  They are launched from a batch file.
 
@ECHO ON
CD %HOME%\bin
CALL clean-temp-dirs
CD %TEMP%
RMDIR /S/Q .
C:
CD C:\J
ROBOCOPY %HOME%\bin . agent.jar
SET JAVA_HOME=C:\Users\MarkE\tools\jdk8u222-b10
SET PATH=%JAVA_HOME%\bin;%PATH%
set SECRET=the-secret-has-been-removed-for-this-email
    java -jar agent.jar -jnlpUrl http://mark-pc2.markwaite.net:8080/computer/cb-pc/slave-agent.jnlp -secret %SECRET%


On Tue, Jul 30, 2019 at 11:39 AM Steve K <Steve.K...@carestream.com> wrote:

Thanks once again Mark.
May I bug you for some more info?  I was really hoping to answer this on my own, but I feel like I'm chasing my tail.  Whenever I do searches for Jenkins agent launch methods, I'm predominantly directed to a description of JNLP usage or, to a lesser extent, SSH; neither of which I want for the Win 7 machines.
Could you please provide a sample script that you leverage?
That would be greatly appreciated! 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/68d09b75-bd6f-4ec8-afdf-000efe443fdb%40googlegroups.com.


--
Thanks!
Mark Waite


--
Thanks!
Mark Waite

Shubham Bansal

unread,
Aug 5, 2019, 7:46:22 AM8/5/19
to Jenkins Users
I launch my Windows agent on Azure using install agent as windows service and running that. But the service keeps restarting very frequently causing the build to break when it is triggered at this time. Can you help me?

On Wednesday, 31 July 2019 04:07:11 UTC+5:30, Mark Waite wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.


--
Thanks!
Mark Waite


--
Thanks!
Mark Waite

Steve K

unread,
Aug 5, 2019, 9:17:07 AM8/5/19
to Jenkins Users
I suggest that you start a new thread. The issue you are facing is different than the topic of this thread.  Thanks.
Reply all
Reply to author
Forward
0 new messages