Azure DevOps agent issue: Microsoft.Azure.DevOps.Pipelines.Agent externsion Could not create lock directory '/agent/.agent.lock
Description
Getting this issue reported here after updating image to 22.04 -> https://github.com/microsoft/azure-pipelines-agent/issues/5312
Reverting image back to 20.04 fixed the issue.
Platforms affected
- [x] Azure DevOps
- [x] GitHub Actions - Standard Runners
- [x] GitHub Actions - Larger Runners
Runner images affected
- [x] Ubuntu 22.04
- [x] Ubuntu 24.04
- [ ] Ubuntu Slim
- [ ] macOS 14
- [ ] macOS 14 Arm64
- [ ] macOS 15
- [ ] macOS 15 Arm64
- [ ] macOS 26 Arm64
- [ ] Windows Server 2019
- [ ] Windows Server 2022
- [ ] Windows Server 2025
Image version and build link
https://github.com/actions/runner-images
Is it regression?
No
Expected behavior
Should not get an issue
Actual behavior
VMSS agent and not getting deployed and having scale issues
Repro steps
Updated image to 20.04 and ran Devops jobs and the instances (Agents) never come up for their job
Description
Getting this issue reported here after updating image to 22.04 -> microsoft/azure-pipelines-agent#5312
Also happens with ubuntu 24.04 ?
Yes, as per the OP -> https://github.com/microsoft/azure-pipelines-agent/issues/5312
Hey @samjack7th-sys! :wave
Thanks for the report.
Unfortunately, this is not an issue in runner-images and does not require changes on our side.
The failure happens inside the Azure DevOps VMSS agent extension (Microsoft.Azure.DevOps.Pipelines.Agent) before the agent is registered. The error
Could not create lock directory '/agent/.agent.lock'
means the extension cannot create the agent lock directory at the path defined by:
"agentFolder": "/agent"
This path is absolute and resolves to /agent at the root filesystem, not a user home directory. If /agent does not exist or is not writable for the user running the extension, the agent setup fails and the VM remains stuck in creating/running.
The agentFolder value is fully user-controlled, and runner-images does not create or manage \agent directorie. The issue is therefore related to Azure DevOps agent extension behavior and its configuration, not the base image.
Recommended actions:
• Use a writable, non-root path for agentFolder (e.g. /home//agent with correct ownership and permissions before the extension runs.
For further investigation, please contact Azure DevOps Pipelines / Agent support.
NOTE: Our Ubuntu images already include the acl package. Reinstalling acl is not required and does not address this failure.