How to set up Visual Studio Code locally and connect to remote system
- Get your IBM i credentials from Yoda
Install the following on your Windows computer
- Download & install Git for Windows - https://git-scm.com/download/win
- Download & install Visual Studio Code - https://code.visualstudio.com/download
Whenever you see %%IBM i Profile%% in the instructions, replace with your IBM i user profile (replace the % too). Whenever you see %%Windows Username%% in the instructions, replace with your Windows user profile (replace the %). Whenever you see shell commands that you need to enter, they will start with "$". This is the command prompt that you will see in the terminal and are not part of the command; do not type the "$" as part of the commands.
Open Visual Studio Code (obviously) Press F1 to open the command prompt (displays at the top of the screen) Type "Terminal: Select Default Shell" in the search bar and press Enter Select "Git Bash" from the drop-down list
Press "Ctrl+" to open the terminal inside Visual Studio Code (displays at the bottom of the screen) -- The "
" should be the key above the Tab key
Enter the following command to change your current working directory to your home:
$ cd ~
$ pwd
This should print something like c/Users/YourWindowsUsername
Enter the following command to generate an SSH key:
$ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-ocean-ssh
Press Enter twice to leave the passphrase blank
Enter the following command to copy your public key to the OC Skunks IBM i:
$ ssh-copy-id -i ~/.ssh/id_rsa-ocean-ssh %%IBM i Profile%%@OCSKUNKS.oceanusergroup.org
When prompted, enter your IBM i password.
Enter the following command to create an SSH connection to the OC Skunks IBM i:
$ ssh %IBM i User%@OCSKUNKS.oceanusergroup.org -i ~/.ssh/id_rsa-ocean-ssh
You should see a "bash-4.4$" prompt.
$ exit
will disconnect the connection.
Press Ctrl+Shift+X to open the Extensions pane (or click the icon in left-hand menu) Type "SSH FS" in the search box Press Install for SSH FS extension
Press F1 to open the command prompt Type "SSH FS: create a SSH FS configuration" and select the link from the drop-down list. Enter the following configuration: Name = "ocean_skunks_ssh_fs" Location = "Global settings.json" Press Save button
On the next screen enter the following configuration: Label = "OCEAN Skunks /home" Group = "OCEAN" Host = "OCSKUNKS.oceanusergroup.org" Root = "/home/%%IBM i Profile%%" Username = "%%IBM i Profile%%" Private key = "c:\Users%%Windows Username%%.ssh\id_rsa-ocean-ssh" Press Save button
Press Ctrl+Shift+E to open the Explorer pane. Open the SSH FILE SYSTEMS group at the bottom. Right-Click on OCEAN Skunks /home Select "Connect as Workspace folder"