I had an instance created from the Deep Learning VM image which stopped allowing me to SSH into it through the Cloud console and went on a constant loop of trying to transfer SSH keys to the VM. Things I tried to get this to work:

  • Access other VMs in the project - these could be accessed
  • Shutdown and restart several times - did not work
  • Created my own pair of SSH keys - did not work

I have now created another instance using the same image - this works. However, when I try to attach my old boot disk in place of the new one, the same problem is appearing. I have installed a fair amount on my old boot disk and would like to keep it so would like to resolve this problem.

Question: What is wrong with my old boot disk that means the SSH keys cannot be transferred to the VM, and how can I fix this?

  • Have a look at the documentation Troubleshooting SSH. Apr 8, 2020 at 20:15
  • I would suggest to add the old boot disk as an additional disk. This will allow you to ssh into the machine and troubleshoot the old disk
    – Patrice
    Apr 8, 2020 at 20:37
  • Look at your Serial Console and check if your disk is not full. Your behavior is quite common when the DISK is full. Apr 9, 2020 at 20:48

2 Answers 2


It's possible that your old boot disk has missing, corrupt, or mismatching SSH host keys (as opposed to user keys) on it which will prevent anyone from making connection to the host. It's also possible your old boot disk has stale IAM data including accounts and user SSH keys.

I'm not familiar with the process, but if it is possible to mount your old boot disk elsewhere in the filesystem tree as opposed to swapping it in place as the boot disk and replacing the original (new) one, that may get you further along.


Try apt install google-guest-agent google-compute-engine, following the recommendation on this page.

The same problem happened to me last night on one of my GCE instances. I usually use ansible to manage my machines, so for all I know this one had broken long ago, but I just noticed it last night. After I installed those packages, Google-managed SSH keys began showing up as I expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.