Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"podman machine start" fails to run in ADO Pipeline Job on Windows Self-Hosted Agent #22513

Open
jailohani opened this issue Apr 26, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. machine windows issue/bug on Windows

Comments

@jailohani
Copy link

jailohani commented Apr 26, 2024

Issue Description

Need to run a CI Pipeline on a windows self-hosted agent where Podman is installed.
At the start of the pipeline, need to start the Podman machine using the command "podman machine start", so that the subsequent build and push commands can be run.

The command works without issue when run manually, but fails when run by the pipeline.

Error Message- Error: fork/exec C:\Users\myuser\AppData\Local\Microsoft\WindowsApps\wsl.exe: The file cannot be accessed by the system.

The agent runs as a service with the username myuser for log on.
Tried giving permissions to myuser for that folder using the following but was unsuccessful in resolving the issue:

icacls "C:\Users\myuser\AppData\Local\Microsoft\WindowsApps\wsl.exe" /grant myuser:F /T

Steps to reproduce the issue

Steps to reproduce the issue

  1. Install Podman
  2. Run podman init machine_name
  3. Run podman machine start machine_name from a script or powershell task in an agent job.

Describe the results you received

Error: fork/exec C:\Users\myuser\AppData\Local\Microsoft\WindowsApps\wsl.exe: The file cannot be accessed by the system

Describe the results you expected

Podman machine should start successfully.

podman info output

IOS: windows/amd64
provider: wsl
version: 5.0.2

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Windows Self Hosted Agent Specs:

Edition Windows Server 2022 Datacenter
Version 21H2
Installed on ‎3/‎3/‎2023
OS build 20348.2402

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@jailohani jailohani added the kind/bug Categorizes issue or PR as related to a bug. label Apr 26, 2024
@ashley-cui
Copy link
Member

Does the pipeline user have permissions to use WSL?

@jailohani
Copy link
Author

Yes, when we login as the same user, both WSL and podman commands work.
Could there be an issue in the commands being run as a background service?

@Luap99 Luap99 added machine windows issue/bug on Windows labels Jun 15, 2024
@pik-256
Copy link

pik-256 commented Jun 24, 2024

Same here. Cannot autostart podman at boot:
Error: fork/exec C:\Users\user\AppData\Local\Microsoft\WindowsApps\wsl.exe: The file cannot be accessed by the system.
It runs correctly in normal session but cannot run when started via TaskScheduler or as a service. I tried to start it with nssm.exe as adviced to autorun a docker. When I run two commands:

wsl --exec whoami >log
podman machine start >>log

then I can see that wsl runs correctly (output: user.) but "podman machine start" fails.
WSL version: WSL: 2.2.4.0
Windows Server 2022

@frontmatec-rws
Copy link

i have the sane issue

@NappySprout
Copy link

I face the same issue trying to run podman machine init using ansible, I also received an error like this
Error: fork/exec C:\Users\myuser\AppData\Local\Microsoft\WindowsApps\wsl.exe: The file cannot be accessed by the system

However the path doesn't exist on the remote windows instance when I rdp into it and check.

The weird thing is RDPing into the machine and running podman machine init manually does not throw an error :P

@kekyo
Copy link

kekyo commented Aug 20, 2024

I have same issue too...

The file is available on error message path and access check is valid on the windows service account:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. machine windows issue/bug on Windows
Projects
None yet
Development

No branches or pull requests

7 participants