Hello Yiming Wu
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Restarting your VM frequently is not a normal practice and it may not solve the issue you are experiencing.
We have noticed few other customers reporting similar issue.
One reason is because you using too small VM for your workload and are getting issues/poor performance due to it being overloaded. This is especially true with new users/trial tier VMs.
There could be several reasons why you are experiencing no response or lost connection when you SSH to your VM. Two possible reasons, Either your VM is not configured correctly or could be an issue with your network connection.
To troubleshoot this issue, please check below mentioned and see if that helps.
- Check if your VM is running and responding to pings.
- Check if your network security group (NSG) is configured correctly for SSH.
- Check if your firewall is blocking the connection from where you are trying SSH.
If everything mentioned is setup correctly and if you are still facing issues, you can try to investigate the logs to further determine the root cause.
Also, try to deploy VM in another region to see if you are facing this issue. Try to deploy Windows VM and cross check once.
If you see still see the same issue, then I would recommend to contact Azure Support to get to the root cause.
Hope this helps.
If you need further help on this, tag me in a comment.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.