azure-devopsdevops

Error adding Virtual Machine Resource in Azure DevOps


I am running an Ubuntu server 22.04LTS in UTM and i want to use it as an environment in azure devops but when i paste the command given to me i get this error

    not a dynamic executable
    not a dynamic executable
    not a dynamic executable
./config.sh: line 92: ./bin/Agent.Listener: cannot execute binary file: Exec format error
sudo: ./svc.sh: command not found
sudo: ./svc.sh: command not found

I would appreciate any solution to my problem

I have tried CATing into the svc.sh file but i dont want to change anything to avoid breaking it


Solution

  • I can reproduce the issue when the processor architecture of my MV isn't x64.

    enter image description here

    The Exec format error indicates that the application was not compiled for the target processor architecture. The reason of the issue is that the default agent downloaded by scripts copied directly from the environment is for x64.

    mkdir azagent;cd azagent;curl -fkSL -o vstsagent.tar.gz https://vstsagentpackage.azureedge.net/agent/3.243.1/vsts-agent-linux-x64-3.243.1.tar.gz;...

    For other processor architecture, we need to change the scripts to download the corresponding agent. To get the URL for other processor architecture, go to Project Settings -> Agent pools -> Select any pool and add new agent -> Select Linux and your target processor architecture -> Click the copy URL button.

    enter image description here

    Edit the original registration scripts by replacing vsts-agent-linux-x64-3.243.1.tar.gz to your target processor architecture. In my test, I am using arm64, so that the scripts will be mkdir azagent;cd azagent;curl -fkSL -o vstsagent.tar.gz https://vstsagentpackage.azureedge.net/agent/3.243.1/vsts-agent-linux-arm64-3.243.1.tar.gz;...