Steps to connect and setup Local VSCode to run on Remote Google Compute Engine host:
-
Create an ngrok token from https://ngrok.com/
-
Make sure to have GPU as runtime
-
Replace 4 variables in the Notebook -
- ngrok token
- password
- Github User
- Github email
-
Run the notebook and enter your AuthToken for connecting gdrive
-
In the second last cell 4 lines containing Host, Hostname, User, Port will be output - note this for use later
-
Leave the last cell running to prevent Colab from closing session
-
Open VSCode on local
-
Make sure to have Settings Sync as On (Type Settings Sync in Command Palette)
-
Install extension Remote Development on local VSCode (if not already installed)
-
Open command palette and type Remote-SSH: Open Configuration File -> /home/$USER/.ssh/config (where $USER = your username)
-
Paste the Host connection details (copied from step 6) and save file
-
Open command palette and type Remote-SSH: Connect To Host and select google_colab_ssh
-
A new VSCode window should open up with google_colab_ssh as Remote Host
-
Accept the fingerPrint prompt; when prompted, type in your password set previously in step 4
-
Go to extensions tab and click on the cloud button beside SSH:GOOGLE_COLAB_SSH - select extensions and install
-
Select the Python interpreter in command palette and select ~/miniconda3/envs/ml/bin/python as your interpreter
-
When opening a new terminal, if (base) env is activated : type conda activate ml first to start running code
You are now setup with VSCode on Local connected to Remote Google Compute Engine!!