Unable to connect through SSH with VS-Code in Mac to a remote GCP VM

0 votes

I have created a compute engine instance (debian) in GCP with a public and private key and able to ssh it from my local mac using the command given below. i have some folders and files in the remote machine which i would like to edit through VS-code( Version: 1.56.1 ) installed in my local. But when I try to connect it through VS code as per the instructions in manual using this command

Mar 19 in GCP by Rahul
• 3,380 points
108 views

1 answer to this question.

0 votes

It looks to be a specific error from VScode and Remote SSH extension. In some cases it worked when the time out value was increased and when the parameter useLocalServer  was set to false. (remote.SSH.useLocalServer": false) under VScode settings. Also try upgrading the version for VScode and see if the issue mitigates. 
To edit files and folders in the remote machine through VS-code you can Connect to a remote host.

Steps to connect to a remote host :

1. Verify you can connect to the SSH host by running the following command

ssh user@hostname

2. In VS Code select Remote SSH: Connect to host, from the Command Palette and use the same user@hostname as step 1   

3. If VS Code cannot automatically detect the type of server you are connecting to you will be asked to select the type manually.

4. After a moment VS Code will connect to the SSH server and set itself up. VS Code will keep you up to date using a progress notification and you can see a detailed log in the Remote-SSH output channel.

5. After you are connected you'll be in an empty window. You  can always refer to the status bar to see which host you are connected to.

6. You can then open any folder on the remote machine using File > Open. From here install any extensions you want to use when connected to the host and start editing.

Refer here for more information,


answered Mar 20 by Korak
• 5,820 points

Related Questions In GCP

0 votes
1 answer

Connect to an instance as a root user in GCP

If you configured an instance to allow ...READ MORE

answered Sep 24, 2019 in GCP by Sirajul
• 59,170 points
2,846 views
0 votes
1 answer

Cannot connect to my VM instance on GCP via SSH.

This might be because UFW is installed. ...READ MORE

answered Sep 27, 2019 in GCP by Sirajul
• 59,170 points
3,279 views
+3 votes
1 answer

GCP Error: "Unable to connect on port 22"

You may see this error under the ...READ MORE

answered Sep 24, 2019 in GCP by Sirajul
• 59,170 points
5,941 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to add a PTR record to my VM instance on gcp?

If your VM instance uses the primary ...READ MORE

answered Sep 26, 2019 in GCP by Sirajul
• 59,170 points
988 views
0 votes
1 answer

Bottleneck while uploading lots of files to GCP bucket in a small time

You might have a hotspot on Cloud ...READ MORE

answered Mar 17 in GCP by Korak
• 5,820 points
50 views
0 votes
1 answer

Unable to install NVIDIA driver on various GCP Ubuntu VM's with Tesla K80 GPU

The mistake you are making here is ...READ MORE

answered Apr 5 in GCP by Korak
• 5,820 points
142 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP