podman icon indicating copy to clipboard operation
podman copied to clipboard

Windows - Podman Machine Service Wrapper using WinSW

Open nddipiazza opened this issue 11 months ago • 9 comments

Feature request description

Add support for using Podman as a background service on a Windows Server 202x intended for use with CI pipelines

Using WinSW , Add a Podman Windows service wrapper to podman

  • Window service management would podman machine stop/start as needed.

Create a set of steps to install Podman as a background service on Windows Server Then show a powershell script example of accessing using a podman client against that shared service

Suggest potential solution

Using WinSW , Add a Podman Windows service wrapper to podman

  • Window service management would podman machine stop/start as needed.

Then ensure the podman client is able to properly access the podman machine hosted by windows service

Have you considered any alternatives?

N/a

Additional context

See: https://github.com/containers/podman/issues/25284 for the origin of this

nddipiazza avatar Feb 14 '25 17:02 nddipiazza

WinSW seems to be abandoned unfortunately https://github.com/winsw/winsw/issues/1102#issuecomment-2562249474 So, one should expect potential blockers implementing this way.

arixmkii avatar Feb 17 '25 09:02 arixmkii

thanks for the comment @arixmkii

baude avatar Feb 17 '25 20:02 baude

shoot i just threw out a windows service wrapper i used in past. dang sucks it's not maintained. teaches me for putting the solution in the feature request

nddipiazza avatar Feb 18 '25 14:02 nddipiazza

It was not to offend anyone. I posted it for additional context strictly from technical perspective. I apologize if it sounded offensive. It is not wrong to propose a solution for evaluation.

arixmkii avatar Feb 18 '25 14:02 arixmkii

is there another idea or approach or should we close this ?

baude avatar Feb 20 '25 19:02 baude

It is possible to run windows service in golang

  • https://dev.to/cosmic_predator/writing-a-windows-service-in-go-1d1m
  • https://pkg.go.dev/golang.org/x/sys/windows/svc/example

This would be custom development, so, considerable amount of effort.

But what I'm more worried about is that original wrapper was designed for Jenkins and alike, and all these apps tend to have their configuration per app inside app folder. Podman machine is a per user, but service will run as privileged technical. So, it would need some mechanism to impersonate (or machine to handle config on demand (there is no code for this)) user while launching (and then machine will be available only for specific user). And having this would expose the service to a whole new vector of attacks. If there would appear RCE during machine start it would become an elevated RCE by service.

I believe there is more of this than just wrap a machine, but a question or feature to implement system wide Podman machine on Windows, where service will be a natural continuation.

arixmkii avatar Feb 21 '25 06:02 arixmkii

It was not to offend anyone. I posted it for additional context strictly from technical perspective. I apologize if it sounded offensive. It is not wrong to propose a solution for evaluation.

@arixmkii nope no offense at all!

But what I'm more worried about is that original wrapper was designed for Jenkins and alike, and all these apps tend to have their configuration per app inside app folder.

Do you happen to know how to use Podman + Jenkins together on Windows? That would be the same thing I am trying to achieve albeit from Azure Devops.

nddipiazza avatar Feb 24 '25 18:02 nddipiazza

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Mar 27 '25 00:03 github-actions[bot]

Hey everyone. I'm trying to use podman in azure devops and if I understood corrently, this is not supported yet. Podman is user based and their is no way to start a podman machine and let the agent service use it. Am I correct?

thomaskvnze avatar Mar 27 '25 14:03 thomaskvnze

Hello everyone, i want to run podman as backgroundservice on windows. Looks like this is not direcly possible or was intended... is it possible to use nssm to get this running. Maybe someone have experience?

DerHulk avatar Aug 29 '25 19:08 DerHulk