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

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • ssh-slaves-plugin
    • None

      I was able to successfully connect the Windows machine with PowerShell/Win32-OpenSSH using the "SSH Build Agents Plugin for Jenkins" 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.

            rkivisto Ray Kivisto
            rkivisto Ray Kivisto
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: