When I build a VM default settings with Ubuntu 16 and CentOS 7 (those are the ones I've tried) I keep getting stuck when I try to do SSH. The message is:
Establishing connection to SSH server...
And then it times out with:
You cannot connect to the VM instance because of an unexpected error.
Wait a few moments and then try again. (#79)
I enabled OS login hoping the behavior will change but it just stays stuck.
Everything is default except that I enabled "HTTP and HTTPS" access when creating the VM. (I tried building it without these options checked and I get to the same problem.
Can you make sure that you have port 22 allowed from your network to the VM? You can create a rule by going to VPC --> Firewall Rules --> Create New Rule.
This page has detailed steps.
Hope this helps.
As manesioz commented, follow this guide to discard the common issues, as you said that this happens immediately after creation, most likely you're missing some firewall rules. Also consider to do a nmap scan to see if the port 22 is open in your instance. Do the next in cloud shell:
sudo apt-get install -y nmap
nmap -Pn YOUR_EXTERNAL_IP
Look for port 22 open
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With