Connect VSCode to Oracle Cloud Compute for Seamless Remote Development

Connect VSCode to Oracle Cloud Compute for Seamless Remote Development

These Steps allow you to work within VSCode and save directly to your Oracle Compute Box. The Terminal window also allows you to run commands directly on your Oracle Compute Box.

Set Access on your Private Key

These are required steps for Windows.

  1. Find your private key which you downloaded when you created your compute box. It will be called something like ssh-key-2024-01-01.key

    If you followed the link above, it is not the puttygen converted priv.pkk. It is the original unconverted file e.g. ssh-key-2024-01-01.key

  2. Drop in to DOS and type

     icacls ssh-key-2023-10-12.key /inheritance:r
     icacls ssh-key-2023-10-12.key /grant:r "%USERNAME%:R"
    

    This will say

     Successfully processed 1 files; Failed processing 0 files
     Successfully processed 1 files; Failed processing 0 files
    
  3. Move on the next step

VSCode Configuration

  1. Open VS and click the Open a Remote Window icon in the bottom-left

  2. Click on SSH (highlighted above)
    It will take a few seconds to install a couple of remote-ssh extensions

  3. Click Configure SSH Hosts

  4. Choose the first config, it'll say something like

     c:\Users\Liam-Cooper\.ssh\config
    
  5. In the config type something like this

     Host # Friendly name for VSCode
       HostName # IP address of the compute box
       User opc
       IdentityFile # link to the private key file for your compute box
    

    e.g.

     Host Summerville
       HostName 4.7.2.5
       User opc
       IdentityFile "C:\keys\summerville\ssh-key-2024-01-01.key"
    
  6. Save the File

  7. Click the Open a Remote Window icon in the bottom-left again

  8. Click Connect to Host e.g Summerville

  9. Select Linux if prompted

  10. Accept any Fingerprint if prompted

Working with the SSH Tunnel

Congratulations. you have a terminal in VScode

[opc@summerville~]$ pwd
/home/opc

You can Open a folder and start working directly on your Oracle Compute box. Here is a picture of me saving a file whilst Terminal window is open.

Also if you Click Remote Explorer > Remotes (Tunnels/SSH) you can manage all the Remotes you have configured.

ENJOY

What's the picture? It's Mother Shipton who predicted the end of times. Visit Yorkshire!