Note: Use of VS Code to connect to the HPC cluster is tolerated —provided the instructions below are followed— but not encouraged.

On this page:

1. Reserve an HPC-VCL Node

Why HPC-VCL? VS Code puts significant strain on shared login node resources. You must connect to an HPC-VCL node rather than a login node.
  1. Go to vcl.ncsu.edu and click Make a ReservationNew Reservation.
  2. In the selection box, type hpc and select exactly: "HPC (RHEL 9 64 bit VM)"
  3. Set your desired duration and click Create Reservation.
  4. Once ready, click "Connect!" and copy the IP address shown after "Remote Computer". This is your <hpc-vcl-ip> for the steps below.

For more information: HPC-VCL documentation

2. Install and Configure VS Code

Install VS Code

  • NCSU-managed computer: Use your university configuration management app (e.g., Jamf Self Service on Mac).
  • Personal computer: Download from code.visualstudio.com.

Install the Remote-SSH extension

Follow the Remote-SSH installation guide, but do not connect to HPC-VCL yet.

Required settings

Apply each of the following settings before connecting. Open the VS Code settings/extensions UI with the keyboard shortcuts shown.

Setting How to find it Value
remote.SSH.showLoginTerminal Cmd+Shift+X [Ctrl+Shift+X] → Remote-SSH → gear → Extension Settings Checked
remote.SSH: Connect Timeout Same as above 300
files.watcherExclude Cmd+, [Ctrl+,] → search for setting name Add pattern: **
search.exclude Cmd+, [Ctrl+,] Add pattern: **
search.followSymlinks Cmd+, [Ctrl+,] Unchecked
trust.banner Cmd+, [Ctrl+,] always

Remove the Todo Tree extension

Cmd+Shift+X [Ctrl+Shift+X] → search for "todo tree" → click Uninstall (if installed).

Use Restricted Mode when browsing files

When using the Explorer sidebar to browse folders, always select "No, I don't trust the authors" when prompted. This activates Restricted Mode and reduces resource usage on the remote node.

3. Connect to HPC-VCL

  1. Cmd+Shift+P [Ctrl+Shift+P] → type "Remote-SSH: Connect to Host..." → press Enter.
  2. Click "Add New SSH Host".
  3. Enter: <user_name>@<hpc-vcl-ip> (your Unity ID and the HPC-VCL IP from step 1) → press Enter.
  4. Press Enter again to accept the default config file location.
  5. Cmd+Shift+P [Ctrl+Shift+P] → "Remote-SSH: Connect to Host..." → select the connection you just created.
  6. If asked for Platform of Remote Host, select Linux.
  7. If asked "Are you sure you want to continue connecting?", type yes.
  8. Enter your password and complete Duo authentication.
  9. If warned about an unsupported OS version, click Allow.
  10. It may take a minute or two to connect. Once connected, open a terminal: menu bar → ViewTerminal, then click + for a new shell.

4. Disconnect When Done

Cmd+Shift+P [Ctrl+Shift+P] → type "Remote: Close Remote Connection" → press Enter.

5. Clean Up Lingering Processes

This section applies only if you connected to a login node (login01, login02, etc.) instead of an HPC-VCL node. If you followed the instructions above and connected to HPC-VCL, you can skip this.

VS Code does not always shut down its SSH tunnel cleanly. You must manually kill lingering processes:

  1. Make sure you have closed the VS Code remote connection (step 4 above).
  2. Log in to the same login node using a terminal (not VS Code):
    <user_name>@<login_node>.hpc.ncsu.edu
  3. Kill lingering VS Code processes:
    ps xu | grep .vscode-server | grep -v grep | awk '{print $2}' | xargs -r kill -9
  4. Confirm they are gone:
    top -u $USER
    Verify no processes named "node" or "code-..." remain.

Caution: The kill command above will terminate all your VS Code processes on that login node, including any active sessions.

6. Troubleshooting

If you cannot connect to Hazel via VS Code, try removing the VS Code server directory:

  1. Connect to a login node using a method other than VS Code (see login instructions).
  2. If you have manually stored important files in $HOME/.vscode-server, move them out first.
  3. Remove the directory:
    rm -rf $HOME/.vscode-server
    It will be recreated automatically on your next VS Code connection.
  4. Try connecting again through VS Code.

Caution: This may terminate all active VS Code sessions and processes across all login nodes.