Running a bash script using WSL

I have a Jenkins Windows install and a bash script that needs to run in wsl as part of my build process.
The build stage runs, but never stops and I have to terminate it manually. There is nothing in the Console Output to indicate where the script gets to.
Currently, I have stripped the script back to “echo hello” and still have the problem.
Is it possible to run wsl, or am I approaching this the wrong way?


1 Like

Hello Martin :wave:

Your Jenkins installation is a standard Windows installation, not an install of Jenkins thanks to the package manager in WSL, right?
What kind of agent are you using? Is it the Built-In Node, or did you install something in WSL?

Hi Bruno
As far as I know, it is a standard Windows install. I haven’t setup another agent so I gues it’s the built-in node.

1 Like

I see, Martin.
I’m sorry but don’t know how to get the built-in agent to launch something on WSL.
I would expect a WSL agent would be the way to go, but I’m in no way an expert.

Thanks. I will give that a try.

1 Like

I started a WSL window on my Windows 11 computer and from inside that window I ran a Jenkins agent process that connected to my controller. It runs shell steps and reports the expected results. I used a swarm agent to do it, though I’m confident that any inbound agent could be used.

An ssh agent on WSL seems unlikely, since the Windows Subsystem for Linux would need to be listening on the SSH port for the entire system.

1 Like