I’m trying to set up a self-hosted agent for Azure DevOps pipelines, but the agent never gets past the Initialization phase. It always hangs while downloading tasks.
Environment
- OS: Ubuntu Server 24.04 LTS
- Agent version: 4.264.2
- Virtualization: VirtualBox VM
- Location: Brazil
- Public IPs:
177.55.197.91(IPv4) and2804:56c:b971:2a00:2ca1:4459:faf9:47ad(IPv6)
The agent connects successfully and shows online, but every job fails during task download (for example, NodeTool, UsePythonVersion).
Symptoms
- Download speed is consistently around 10 KB/s
- Initialization eventually fails with Connection reset by peer
- Pipeline never starts the actual steps, only looping on “Downloading tasks…”
Error screenshot:
What I have already tried
I tested multiple network/VM configurations in VirtualBox:
- Bridged Adapter
- NAT
- Host-only + NAT
- Changing DNS resolvers (Google, Cloudflare, local)
- Disabling firewall
- Enabling firewall with explicit allow rules
- Configuring an HTTPS caching proxy using Squid
The issue persists in all scenarios.
Log details (full exception)
[debug]System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer.
---> System.Net.Sockets.SocketException (104): Connection reset by peer
at System.Net.Sockets.NetworkStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.Sockets.SocketAsyncEventArgs.TransferCompletionCallbackCore(Int32 bytesTransferred, Memory`1 socketAddress, SocketFlags receivedFlags, SocketError socketError)
at System.Net.Sockets.SocketAsyncEngine.System.Threading.IThreadPoolWorkItem.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
--- End of stack trace from previous location ---
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.Http.HttpConnection.FillAsync(Boolean async)
at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken)
at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, TaskStepDefinitionReference task)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps)
at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message)
Question
Has anyone faced similar behavior where a self-hosted Azure DevOps agent becomes extremely slow only during Azure task downloads?
Is this related to VirtualBox networking, Brazil CDN edge issues, Azure throttling, or something else?
Any working setups, network adjustments, or insights on how to solve this are very welcome.
