Linux VM Agent not working..

Administrator 0 Reputation points
2023-10-04T13:00:22.0533333+00:00

I have a Ubuntu 18.04 server that is not accessible from the internet. It seems as though the VM Agent isn't communicating properly. I've done some of the basic trouble shooting provided by Azure, but I can't figure out why it's not working.

Any help would be appreciated.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,291 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jackson Martins 9,801 Reputation points MVP
    2023-10-04T13:15:37.0566667+00:00

    Hi administrator

    There are several issues that can prevent the connection, normally items 4 and 5 usually resolve them, so here is a systematic approach:

    I Helped someone with the same problem, you can verify this here:
    https://learn.microsoft.com/en-us/answers/questions/958515/vm-linux-agent-status-not-ready-unable-to-ssh-rest

    1 - Check Network Configuration:

    Make sure you haven't modified the default network configuration, which Azure relies on.

    Check the Azure portal for any NSG (Network Security Group) rules that might be blocking traffic. Ensure SSH (port 22) is allowed.

    2 - Disk Space:

    Ensure that the VM hasn't run out of disk space, which can cause multiple services (including the agent) to malfunction:

    df -h

    3 - Firewall IPtables

    Ensure your VM's firewall isn't blocking the necessary ports or IP ranges used by Azure services.

    setenforce 0

    iptables -L or iptables -F to clean all rules

    4 - Verify the VM Agent Status:

    SSH into the VM (if possible) or use Serial Console from the Azure portal to access the VM.

    sudo systemctl status walinuxagent

    sudo systemctl restart walinuxagent

    or

    5 - Try to reinstall VM agent, you can use serial console and connect to Linux directly. After connect you can run:

    • systemctl stop walinuxagent
    • waagent -deprovision -force
    • apt-get remove --purge walinuxagent
    • rm -rf /var/lib/waagent

    then, install the latest package version, following the instruction from the document below:

    reference: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/update-linux-agent

    Connect via serial console to fix the connection.
    reference: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-linux

    below article that helps you find and correct the problems that occur due to Secure Shell (SSH)
    Reference: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection

    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    0 comments No comments