Ubuntu VM 22.04 simple CLI command "freeze"
Recently (I think about a month), all our Ubuntu VMs having strange behaviour.
The simple command like cat, ls, nano etc often 'frozen'.
When I run apt update, it usually ended up with "scanning ... " and this would also "frozen" (not able to see the process completed until the SSH connection disconnected - Broken pipe..).
Anyone have similar experience could kindly share what actually causing this please.
Thank you,
Azure Virtual Machines
-
Vamsi Ram Annepu • 225 Reputation points • Microsoft External Staff
2025-02-28T07:24:01.73+00:00 Hi jazzspeed,
Thank you for reaching out to us on the Microsoft Q&A forum.
You can try to uninstall and reinstall your Azure CLI using the commands to try solving issueInstall the Azure CLI on Linux | Microsoft Learn
We would like to know more about your Ubuntu VMs configuration and if you are using any 3rd party app like puTTy for the connection or bash in Azure portal.
Feel free to reach us out with further queries. -
jazzspeed • 25 Reputation points
2025-02-28T08:52:41.8933333+00:00 Hi Vamsi,
Thank you for your suggestion.
FYI, I connect to my Azure Ubuntu VM via SSTP VPN + ssh command line from my notebook (not using putty or other 3rd party ssh client).
This has been great so far for the past around 2 years+.
Until started probably end of Jan 2025 (last month) I started having all simple Ubuntu CLI frozen.
I have currently managing 3 Ubuntu VMs: 2 PROD instances and 1 UAT.
All of them running on Ubuntu 22.04.
The UAT instance is quite recently created. And all of them are under Microsoft Cloud Defender.
And because of 'frozen' CLI I encounter lately, I did testing in UAT instance by removing the extension of MDE.Linux (which I thought it could be one of the reason).
But unfortunately it doesn't solve the issue.
Still all "cat", "nano", vi, ls etc would just freeze. I can't even see the content of small txt file using cat command.
And one more thing, I did test using sftp command to the vm.
"put" a file is no issue, but "get" a file is always stalled.
Thank you so much. I will take a look the link you shared and test that and share you the result.
Best regards,
-
jazzspeed • 25 Reputation points
2025-03-03T12:43:51.7233333+00:00 Hello,
I have tried to uninstall and reinstall, but the problem persist.
I really suspect the "scanning" package running on azure VM could probably caused this.
I wanted to test by trying to disable it from Microsoft Cloud Defender, but seems not able to do so. The 'scanning' Example below screenshot:
Any idea which package to remove or to disable please? Or some configuration I can look into it?
Thank you & Best regards,
-
Vamsi Ram Annepu • 225 Reputation points • Microsoft External Staff
2025-03-04T11:05:01.8966667+00:00 Hi jazzspeed,
Thank you for the update.
There might be few reasons for the issue of freezing.
Here are some commands you can run to diagnose and potentially resolve the issues you're experiencing.
1.Check System Resource Usage for
CPU and Memory Usage:(Look for processes consuming excessive CPU or memory.)
topDisk Usage:(Check if any partitions are full)
df -hDisk I/O:(You may need to install sysstat package to use iostat. Look for high I/O wait times.)
iostat -x 12.Check System Logs: (Review system logs for any errors or warnings)
sudo journalctl -xe3.Check Network Connectivity:(Test network connectivity to ensure there are no issues,Check for packet loss or high latency.)
ping google.com4.Check for Zombie Processes: (Look for any zombie processes that might be consuming resources)
ps aux | grep Z5.Check for Disk Errors:(Run a filesystem check. Replace "/dev/sdX" with your device.)
sudo fsck -f /dev/sdX6.Check for Swap Usage:(If swap usage is high, your system is running out of RAM)
free -h7.Check for Running Services:(Check if any services are consuming excessive resources resulting in freezing)
systemctl list-units --type=service8.Reboot the VM: Ensure you save any important work before rebooting your VM.
Hope this helps you, please let us know if this was useful.
If you have any further queries do let us know. We are happy to assist you! -
jazzspeed • 25 Reputation points
2025-03-05T13:27:55.7333333+00:00 (duplicate reply)
-
jazzspeed • 25 Reputation points
2025-03-05T13:33:01.95+00:00 Dear Vamsi,
Once again Thank you so much for giving me some suggestions.
However, this is actually the issue I raised in my question.
Mostly Ubuntu CLI command in my VM frozen / Hang.
I have so much difficulties now just to do some adminsitrative work such as: updating app env, or some other configurations that require to modify configuration files.
Because vi, nano, top, etc (or just to check the sys log etc) the command would just hang until ssh connection got timeout and disconnected.
I just give you another example I just did below, where I executed 2 command:
free -h
top (as you can see, as soon as this command is executed, it is just hang and not able to proceed anymore and no output shown).
Thank you & Best regards,
-
Vamsi Ram Annepu • 225 Reputation points • Microsoft External Staff
2025-03-06T12:13:18.6366667+00:00 Hi jazzspeed,
Thank you for the update.
In your previous message the image shows a command "do-release-upgrade" could you try it and if the problem persists could you try the previous command we suggested and send the screen shorts of them as well for our better understanding of the problem so that we can help you further.
Thank you. -
jazzspeed • 25 Reputation points
2025-03-07T09:24:06.5066667+00:00 Hi Vamsi,
Thanks for your suggestions.
I have to check first before I can execute do-release-upgrade.
Reason for us not deploying the latest Ubuntu 24.x - because certain components required by our app - at that time around 2 months ago - was not yet being supported by Microsoft (only supported up-to Ubuntu 22.x).
I will need to double-check on this first, then only I can decide whether to proceed with release upgrade or not.
I find it this issue really strange - which I thought I suspect due to some recent kernel updates or related to security app/package used by Azure.
Anyway, I will check and update you again.
Thank you
Sign in to comment