Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Connecting a workstation to Local Editor

Hi,
I have a workstation created from code-oss image. Now i want to connect the workstation to local VSCode editor. I didn't find proper documentation for that. Could you please provide me the steps to achieve the functionality?
Thanks

0 1 904
1 REPLY 1

Hi @avinashkz,

Welcome to Google Cloud Community!

To connect a Google Cloud workstation to a local VSCode editor, you can use the Remote Development extension in VSCode. Here are the steps to set it up:

1. Install the Remote Development extension in VSCode.
2. Open the workstation in the Google Cloud Console and make sure that the SSH port (22) is open in the firewall.
3. Open VSCode, and click on the Remote Explorer icon in the sidebar (or press `CTRL+SHIFT+P` and type "Remote-SSH: Open Configuration File")
4. Add the following to your ssh config file:

Host <your-workstation-name>
    HostName <your-workstation-ip>
    User <your-username>
    IdentityFile <path-to-your-private-key>

Replace `<your-workstation-name>`, `<your-workstation-ip>`, `<your-username>`, and `<path-to-your-private-key>` with the appropriate values for your workstation.5. Press `CTRL+SHIFT+P` and type "Remote-SSH: Connect to Host"
6. Select your workstation name that you entered in step 4 and you will be connected to the workstation.
7. Open the folder you want to edit on the workstation and start editing the files.
8. The changes will be automatically synced to the workstation and can be run from there.

Thank you