title: How to connect VSCode to GCP instances
body: <p>I am trying to connect VSCode to my GCP instances but am unable to. From a terminal, I can ssh into the machines with <code>gcloud compute ssh my_machine_name</code> but I'm not sure how to translate that into what VSCode Remote-SSH is looking for. When I created the config in VSCode I did this:</p>
  <pre><code>Host my_machine_name
      HostName my_machine_name
      User me@my_company.com
  </code></pre>
  <p>But the HostName is wrong because it's just the name of the machine and not the full HostName or IP address. I haven't even told VSCode that it's a GCP instance. How do I find the HostName? I imagine there's a connection between <code>my_machine_name</code> and the true HostName somewhere in my configs, but I can't find it. I found a GCP-Service.json file with the following keys:</p>
  <pre><code>{
    &quot;type&quot;: 
    &quot;project_id&quot;: 
    &quot;private_key_id&quot;: 
    &quot;private_key&quot;: 
    &quot;client_email&quot;: 
    &quot;client_id&quot;: 
    &quot;auth_uri&quot;: 
    &quot;token_uri&quot;: 
    &quot;auth_provider_x509_cert_url&quot;: 
    &quot;client_x509_cert_url&quot;: 
  }
  </code></pre>
  <p>but I don't see anything that looks like a HostName or IP address.</p>
  <p>Just to see, I tried to connect and got the following error:</p>
  <pre><code>Could not establish connection to &quot;my_machine_name&quot;: Permission denied (publickey).
  </code></pre>
  <p>(Note sure if this is relevant but sometimes when I first try to connect I get the following, but after I click &quot;Retry&quot; it goes back to the publickey message again):</p>
  <pre><code>&quot;Could not establish connection to &quot;my_machine_name&quot;: Remote host key has changed, port forwarding is disabled.&quot;
  </code></pre>
  <p>So I tried to add a private key like so:</p>
  <pre><code>Host my_machine
      HostName my_machine
      User user@my_company.com
      IdentityFile ~/.ssh/id_rsa
  </code></pre>
  <p>I also tried the private key from my GCP-Service.json file as well but got the same result. What am I supposed to do to connect VSCode to my GCP instance?</p>