Logging in with VS Code
Instructions are given for Mac. Windows/Linux alternatives are shown in [square brackets].
On this page:
- 1. Reserve an HPC-VCL node
- 2. Install and configure VS Code
- 3. Connect to HPC-VCL
- 4. Disconnect when done
- 5. Clean up lingering processes
- 6. Troubleshooting
1. Reserve an HPC-VCL Node
- Go to vcl.ncsu.edu and click Make a Reservation → New Reservation.
- In the selection box, type hpc and select exactly: "HPC (RHEL 9 64 bit VM)"
- Set your desired duration and click Create Reservation.
- 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
Cmd+Shift+P[Ctrl+Shift+P] → type "Remote-SSH: Connect to Host..." → press Enter.- Click "Add New SSH Host".
- Enter: <user_name>@<hpc-vcl-ip> (your Unity ID and the HPC-VCL IP from step 1) → press Enter.
- Press Enter again to accept the default config file location.
Cmd+Shift+P[Ctrl+Shift+P] → "Remote-SSH: Connect to Host..." → select the connection you just created.- If asked for Platform of Remote Host, select Linux.
- If asked "Are you sure you want to continue connecting?", type yes.
- Enter your password and complete Duo authentication.
- If warned about an unsupported OS version, click Allow.
- It may take a minute or two to connect. Once connected, open a terminal: menu bar → View → Terminal, 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
VS Code does not always shut down its SSH tunnel cleanly. You must manually kill lingering processes:
- Make sure you have closed the VS Code remote connection (step 4 above).
- Log in to the same login node using a terminal (not VS Code):
<user_name>@<login_node>.hpc.ncsu.edu
- Kill lingering VS Code processes:
ps xu | grep .vscode-server | grep -v grep | awk '{print $2}' | xargs -r kill -9 - 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:
- Connect to a login node using a method other than VS Code (see login instructions).
- If you have manually stored important files in
$HOME/.vscode-server, move them out first. - Remove the directory:
rm -rf $HOME/.vscode-server
It will be recreated automatically on your next VS Code connection. - Try connecting again through VS Code.
Caution: This may terminate all active VS Code sessions and processes across all login nodes.