Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57126

Support alternative drive letters for Windows ssh agents using PowerShell/Win32-OpenSSH



    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: ssh-slaves-plugin
    • Labels:
    • Environment:
    • Similar Issues:


      I was able to successfully connect the Windows machine with PowerShell/Win32-OpenSSH using the "SSH Slaves plugin" using the "Remote root directory" of "C:\jenkins-agent", and I'm able to run Windows builds on this agent.

      The issue occurs when I change the "Remote root directory" to "D:\jenkins-agent", then the agent fails to launch:

      [04/20/19 09:21:28] [SSH] Remote file system root D:\jenkins-agent does not exist. Will try to create it...

      [04/20/19 09:21:28] [SSH] Copying latest remoting.jar...

      [04/20/19 09:21:29] [SSH] Copied 789,283 bytes.
      Expanded the channel window size to 4MB
      [04/20/19 09:21:29] [SSH] Starting agent process: cd "D:\jenkins-agent" && "C:\Program Files (x86)\Java\jre1.8.0_201\bin\java.exe" -jar remoting.jar -workDir D:\jenkins-agent
      Error: Unable to access jarfile remoting.jar
      Slave JVM has terminated. Exit code=1
      [04/20/19 09:21:29] Launch failed - cleaning up connection
      [04/20/19 09:21:29] [SSH] Connection closed.

      The root cause appears to be that the command 'cd "D:\jenkins-agent"' does not successfully change to the D:\ drive, because when using Windows command prompt, you need to add the '/d' argument to the 'cd' command to change the drive:

      /d : Changes the current drive or the current directory for a drive.


          Issue Links


            rkivisto Ray Kivisto created issue -
            rkivisto Ray Kivisto made changes -
            Field Original Value New Value
            Comment [ I am able to work around this error by adding a "Prefix Start Agent Command" of:

            {{cd /d D:\ && }}

            Then the agent will connect successfully, and I'm able to run Windows builds on this agent. ]
            rkivisto Ray Kivisto made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            ifernandezcalvo Ivan Fernandez Calvo made changes -
            Remote Link This issue links to "Instructions in the troubleshooting guide (Web Link)" [ 23264 ]
            rkivisto Ray Kivisto made changes -
            Link This issue duplicates JENKINS-55362 [ JENKINS-55362 ]
            rkivisto Ray Kivisto made changes -
            Resolution Duplicate [ 3 ]
            Status In Progress [ 3 ] Closed [ 6 ]


              rkivisto Ray Kivisto
              rkivisto Ray Kivisto
              2 Vote for this issue
              4 Start watching this issue