Basin:VSCode

From Computer Science
Revision as of 18:11, 23 April 2023 by Christopher Andrews (talk | contribs) (→‎Remote access to Basin from VSCode)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Remote access to Basin from VSCode

Installation

Open up the Extensions pane in VSCode.

Vscode-extensions.png


Search for 'Remote - SSH' and click install.


Connecting

Once the extension is installed, you should have a little blue tab in the lower left hand corner.

Vscode-connection-corner.png


When you click it, a menu will open at the top of the window.


Vscode-connection-menu.png

Select 'Connect to host' or 'Connect current window to host...'. The first will open a new window for your connection, the other will use the current window.

Once you select one, you will be asked to enter in a hostname.

Vscode-add-host.png

Option 1: You can just type in username@basin.cs.middlebury.edu (where username is your Middlebury username) and connect directly. The username@ portion can be left off if the username on your local computer matches your Middlebury username.

Option 2: You can configure basin as a host making it easy to return to later. Select "Configure SSH Hosts..." from the menu. It will ask which configuration file you want to edit. Look for one that looks like it is stored in ".ssh/config". If you don't have this file, it will bring up a template.


Vscode-ssh-template.png

I suggest using

  • Host "basin"
  • HostName "basin.cs.middlebury.edu"
  • User your Middlebury username

If you already had a file, you can add this same information in anywhere

You will need to try to connect again, but this time you will see "basin" in the list of options. Select that and enter your password as necessary (if you set up SSH keys, then you won't need to use your password).

If you were successful, the lower corner should now indicate that you are connected.


Vscode-connceted.png

Working on basin

Once you are connected, you can open file or folders in the remote folder. I suggest opening a folder. You can use the file pane on the left to add new files or folders, etc. Note that to open a folder you need to select one form the drop down and then click the "Ok" button.

If you type C-~ (that is the control key and the tilda character) or choose "New Terminal" from the the "Terminal" menu, you will open a new shell session on basin. This will allow you to, for example, compile your code and run it (provided it doesn't have a visual interface).


Disconnecting

To disconnect, click the lower left corner again and then choose "Close Remote Connection" from the drop down menu.