Skip to content

Visual Studio Code Tunnel

VACC Open OnDemand offers an application that will launch a VS Code Tunnel on a compute node for remote development. For official VS Code documentation, see https://code.visualstudio.com/docs.

Prerequisites

You must have a local installation of the VS Code application on your own computer or laptop. If you do not already have VS Code installed on your computer, see https://code.visualstudio.com/download to download the appropriate installer for your operating system.

You must also install the Remote Development extension pack for VS Code. Click the "Extensions" icon on the left side panel or use the shortcut keys (PC: Ctrl+Shift+X, Mac: Cmd+Shift+X). In the Extensions search bar, enter "Remote Development". It should be the first option returned. Click the "Install" button to install, if it's not already installed. Install any other extensions as desired.

Connecting

In our VACC Open OnDemand web portal, select VS Code Tunnel from the "Interactive Apps" menu. Select your job parameters and click the blue "Launch" button at the bottom of the form. When your job has started, click the blue "Connect" button. A tmux session is started that will keep your tunnel open for the duration of your job session.

Logging in the first time

If this is your first time using this app, if it's been more than 24 hours since your last use of this app, or if you checked the box in the Open OnDemand form to "Cleanup previous VS Code Tunnel login data," follow these instructions next:

In the tmux terminal that opens, you will be presented with the question regarding how you would like to log in to Visual Studio Code. > Microsoft Account should be highlighted in green. Click Enter in the terminal to accept Microsoft Account as your log in method. A new line will print into the tmux terminal. Copy the device code that is provided and then click the URL for device login. In the new tab that opens, paste the code and click the blue "Next" button. Click the option to select your Microsoft UVM account, then click the "Continue" button when asked if you're trying to sign into VS Code. You may close the Microsoft login tab when prompted.

Subsequent sessions

If you've used this app previously, it is less than 24 hours since your previous use of the VS Code Tunnel app, and you did NOT check the box to "Cleanup previous VS Code Tunnel login data" in the Open OnDemand form, follow these instructions next:

By not selecting the option to clean up previous login data, your login credentials should be be saved for up to 24 hours, and you can skip that step. In the tmux terminal that opens, instead you will be presented with a link that will open a VS Code session in a new tab of your browser. We do not support this method of connecting. Instead, ignore the link and open the VS Code application installed on your local computer.

Accessing the Tunnel from your local VS Code application

Open VS Code on your local machine and make sure you are logged in via your UVM Microsoft account. If you are not connected automatically to the tunnel, please enter "connect to..." in the Command Palette and then "Connect to Tunnel". Choose Microsoft Account on the drop-down menu and select the tunnel named "vsc-\<your account>-vacc". Alternatively, you can select the "Remote Explorer" icon in the left-hand panel and navigate to the Tunnel from there.

Note: We only support VS Code tunnel access via the VS Code application installed locally on your own machine. Connecting to the VS Code tunnel using the URL via a web browser is not supported, since web access cannot be guaranteed to work for all browsers and operating systems.

Logging off

When you are finished, press Ctrl+C in the tmux terminal to close the tunnel. Enter "exit" on the command line. You may then close the tmux tab. Finally, you must click the red "Delete" button on the "My Interactive Sessions" page of Open OnDemand to end the Slurm job.

Please do not use VS Code to ssh to the login nodes; use a VS Code Tunnel connection instead.