PRODUCTS AND SUPPORT


How to get VSCode Cloud IDE on GCP(Google Cloud Platform)




This section describes how to launch and connect to VSCode Cloud IDE in a Google Compute environment.


  1. Open VSCode Cloud IDE listing on GCP Marketplace
  2. Click Launch.
  3. /img/gcp/vscode/marketplace.png


    • Select a zone where you want to launch the VM(such as us-east1-)
    • Optionally change the number of cores and amount of memory. ( This defaults to 1 vCPUs and 3.75 GB ram)
    • Optionally change the boot disk type and size. (This defaults to 'Standard Persistent Disk' and 10 GB respectively)
    • Optionally change the network name and subnetwork names. Be sure that whichever network you specify has ports 22 (for ssh), 3389 (for RDP) and 443 (for HTTPS) exposed.
    • Click Deploy when you are done.

      VSCode Cloud IDE will begin deploying.

    /img/gcp/vscode/deployment-page.png


  4. A summary page displays when the compute engine is successfully deployed. Click on the Instance link to go to the instance page .

  5. On the instance page, click on the "SSH" button, select "Open in browser window".

  6. /img/gcp/jupyter-python-notebook/ssh-option.png


  7. This will open SSH window in a browser.
  8. Run below command to set the password for "ubuntu" user
  9. sudo passwd ubuntu

    /img/gcp/jupyter-python-notebook/ssh-passwd.png

  10. Now the password for ubuntu user is set, you can connect to the VM's desktop environment from any local windows machine using RDP or linux machine using Remmina.

  11. To connect using RDP via Windows machine, first note the external IP of the VM from VM details page as highlighted below

  12. /img/gcp/vscode/external-ip.png

  13. Then From your local windows machine, goto "start" menu , in the search box type and select "Remote desktop connection"

  14. In the "Remote Desktop connection" wizard, paste the external ip and click connect

  15. /img/gcp/jupyter-python-notebook/rdp.png

  16. This will connect you to the VM's desktop environment. Provide "ubuntu" as the userid and the password set in step 6 to authenticate. Click OK

  17. /img/gcp/jupyter-python-notebook/rdp-login.png

  18. Now you are connected to out of box VSCode Cloud IDE environment via Windows machines.

  19. /img/gcp/vscode/rdp-desktop.png

  20. To connect using RDP via Linux machine, first note the external IP of the VM from VM details page,then from your local Linux machine, goto menu , in the search box type and select "Remmina".

    Note: If you don't have Remmina installed on your Linux machine, first Install Remmina as per your linux distribution.


  21. /img/gcp/common/remmina-search.png

  22. In the "Remmina Remote Desktop Client" wizard, select the RDP option from dropdown and paste the external ip and click enter.

  23. /img/gcp/common/remmina-external-ip.png

  24. This will connect you to the VM's desktop environment. Provide "ubuntu" as the userid and the password set in step 6 to authenticate. Click OK

  25. /img/gcp/common/remmina-rdp-login.png

  26. Now you are connected to out of box VSCode Cloud IDE environment via Linux machine.

  27. /img/gcp/vscode/rdp-desktop.png

  1. For accessing VSCode in browser, SSH to the VM as shown in Step 4 and run below command-

    cat /home/ubuntu/vscode_pass.txt.

    Note down auto-generated password.

    Note: If the password is empty in the file, wait for 2 minutes and check again.

  2. /img/gcp/vscode/vscode-web-interface-passwd-file.png
  3. Go to https://VM_Public_IP. Make sure you type https and not http.
  4. You will see certificate warning, accept the warning to proceed for login
  5. /img/gcp/vscode/certificate-warning.png

  6. Use above auto-generated password from Step 17
    Note: If you happen to see a blank screen in the browser after login or page load error, wait for 1-2 minutes and open again in new browser window to see VSCode load.
  7. /img/gcp/vscode/vscode-web-login.png

    /img/gcp/vscode/vscode-in-browser.png

  8. We recommend to reserve the VSCode public ip address and make it static in order to access VSCode in browser over the same IP after VM restart.
    Having static IP will also allow the browser to save VSCode password across sessions and user will not have to enter password each time VSCode is opened in browser.
  9. Below are the steps for reserving public IP and making it static:

    • Once the vm is up and running, go to VM instance details page and click on Edit option.

    • /img/gcp/vscode/static-ip-vm-edit-option.png

    • Scroll down to Network Interfaces and edit nic0.

    • /img/gcp/vscode/static-ip-vm-edit-nic0.png

    • From External IP dropdown select Create IP address

    • /img/gcp/vscode/create-ip-address.png

    • Give Name and Description and click on Reserve

    • /img/gcp/vscode/Reserve-new-static-ip.png

    • Click on Save at the bottom of the page.

    • /img/gcp/vscode/click-save-static-ip.png

    • Now Static IP is assigned to the VM.

    • /img/gcp/vscode/static-ip-on-vm-details-page.png