<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.gacrc.uga.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Moses</id>
	<title>Research Computing Center Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gacrc.uga.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Moses"/>
	<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/wiki/Special:Contributions/Moses"/>
	<updated>2026-05-09T12:48:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Training&amp;diff=22971</id>
		<title>Training</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Training&amp;diff=22971"/>
		<updated>2026-05-04T12:52:57Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==GACRC Training==&lt;br /&gt;
&lt;br /&gt;
The GACRC regularly hosts training sessions on a number of subjects relevant to the use of our computational and storage resources. Scheduled trainings will be announced through the GACRC mailing list. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: New users are required to attend a Sapelo2 cluster introductory training session and information about that will be sent once an account is requested.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Regular Training Announcement==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;April 2026&#039;&#039;&#039;, the GACRC is hosting 9 training sessions listed below. These training workshops will be offered remotely via Zoom Meeting. Detailed instructions for joining the Zoom meeting will be sent to your UGA email account before each training session you register for.&lt;br /&gt;
&lt;br /&gt;
We will offer:&lt;br /&gt;
&lt;br /&gt;
1. Linux training for Linux-inexperienced cluster new users (3 sessions)&lt;br /&gt;
&lt;br /&gt;
2. Sapelo2 cluster new user training (3 sessions)&lt;br /&gt;
&lt;br /&gt;
3. Sapelo2 Part II (1 session)&lt;br /&gt;
&lt;br /&gt;
4. Job Parallelization with GNU Parallel and Slurm Arrays (1 session)&lt;br /&gt;
&lt;br /&gt;
5. Installing Software Packages in Virtual Environments on Sapelo2 (1 session)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;May 2026&#039;&#039;&#039;, the GACRC is hosting 9 training sessions listed below. These training workshops will be offered remotely via Zoom Meeting. Detailed instructions for joining the Zoom meeting will be sent to your UGA email account before each training session you register for.&lt;br /&gt;
&lt;br /&gt;
We will offer:&lt;br /&gt;
&lt;br /&gt;
1. Linux training for Linux-inexperienced cluster new users (3 sessions)&lt;br /&gt;
&lt;br /&gt;
2. Sapelo2 cluster new user training (3 sessions)&lt;br /&gt;
&lt;br /&gt;
==Event Schedule==&lt;br /&gt;
&lt;br /&gt;
This section describes the training workshops that we offer, along with the sessions that are currently scheduled.&lt;br /&gt;
&lt;br /&gt;
===Sapelo2 Cluster New User Training===&lt;br /&gt;
&lt;br /&gt;
This mandatory training consists of an overview of the structure of Sapelo2 as well as hands-on practice submitting a job along with guidance and best practices when using the Sapelo2 cluster. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*Linux basics. A Linux-inexperienced user must complete a prerequisite Linux training for Linux-inexperienced cluster new users.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Workshop Training Goals:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
*Understand the layout of Sapelo2&lt;br /&gt;
&lt;br /&gt;
*Understand the Sapelo2 file systems&lt;br /&gt;
&lt;br /&gt;
*Understand the Sapelo2 partitions&lt;br /&gt;
&lt;br /&gt;
*Understand the Sapelo2 software environment&lt;br /&gt;
&lt;br /&gt;
*Understand how to request computing resources and submit a computational batch job following the Sapelo2 cluster general workflow&lt;br /&gt;
&lt;br /&gt;
*Understand how to initiate an interactive job&lt;br /&gt;
&lt;br /&gt;
*Understand how to transfer files to and from the cluster&lt;br /&gt;
&lt;br /&gt;
*Understand how to get support from GACRC support team when you have any issues on cluster&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scheduled Sessions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time &lt;br /&gt;
|-&lt;br /&gt;
|Using Sapelo2 Cluster at the GACRC&lt;br /&gt;
|May 8th, Friday, 2:00 PM - 4:00 PM&lt;br /&gt;
|-&lt;br /&gt;
|Using Sapelo2 Cluster at the GACRC&lt;br /&gt;
|May 14th, Thursday, 2:00 PM - 4:00 PM&lt;br /&gt;
|-&lt;br /&gt;
|Using Sapelo2 Cluster at the GACRC&lt;br /&gt;
|May 20th, Wednesday, 2:00 PM - 4:00 PM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Linux Training for Linux-inexperienced Cluster New Users===&lt;br /&gt;
The Sapelo2 High Performance Computing (HPC) cluster runs a headless Linux distribution as the operating system on each of its constituent nodes. The term headless refers to the fact that these nodes do not have a desktop graphical user interface (GUI) installed by default. Graphical desktop environments consume resources that analyses could otherwise use, so users employ a command-line interface (CLI) instead. To interact with these resources, users connect to a remote terminal via SSH and execute commands.&lt;br /&gt;
&lt;br /&gt;
The Linux Training workshop provides hands-on practice of the fundamental Linux commands necessary to interact with HPC resources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Please watch the introductory videos on Linux, basic Linux terms, and Linux Paths and Directories (total ~17 minutes) &#039;&#039;&#039;before attending the training workshop&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
*[https://kaltura.uga.edu/media/t/1_81u2kfi2/176125031 Linux]&lt;br /&gt;
*[https://kaltura.uga.edu/media/t/1_ol51cuyn/176125031 basic Linux terms]&lt;br /&gt;
*[https://kaltura.uga.edu/media/t/1_wdyxhgdg/176125031 Linux Paths and Directories]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Understand fundamental concepts of Linux working environment (filesystem hierarchy, path, PATH, etc.)  &lt;br /&gt;
&lt;br /&gt;
2. Know how to use Linux common commands (ls, cd, pwd, cat, more, nano, mkdir, rm, cp, mv, etc.)&lt;br /&gt;
&lt;br /&gt;
3. Understand what is Linux bash shell and know how to make a simple Linux script and run it in Linux environment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scheduled Sessions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Use Linux on Cluster&lt;br /&gt;
|May 6th, Wednesday, 1:00 PM - 3:00 PM&lt;br /&gt;
|-&lt;br /&gt;
|Use Linux on Cluster&lt;br /&gt;
|May 12th, Tuesday, 1:00 PM - 3:00 PM&lt;br /&gt;
|-&lt;br /&gt;
|Use Linux on Cluster&lt;br /&gt;
|May 18th, Monday, 1:00 PM - 3:00 PM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Using Sapelo2 Cluster at the GACRC, Part II ===&lt;br /&gt;
This workshop will cover high-performance computing on Sapelo2, including job scheduling, resource requests (CPU, memory, GPU), and techniques for optimizing job performance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prerequisites:&#039;&#039;&#039;&lt;br /&gt;
*Linux basics. A Linux-inexperienced user must complete a prerequisite Linux training for Linux-inexperienced cluster new users.&lt;br /&gt;
*Sapelo2 cluster new user training.  Fundamental HPC and Sapelo2 knowledge is required for this advanced Sapelo2 workshop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Learn about high-performance computing framework&lt;br /&gt;
&lt;br /&gt;
2. Why is my job pending? How can I get my job to start sooner? How to find available computing resources on Sapelo2?&lt;br /&gt;
&lt;br /&gt;
3. How to request computing resources such as nodes, CPU cores, memory, GPU device, etc. to run serial, threaded, MPI, and GPU jobs on Sapelo2?&lt;br /&gt;
&lt;br /&gt;
4. How can I make my job run more efficiently (through the correct use of software and hardware)?&lt;br /&gt;
&lt;br /&gt;
5. A quick intro to MPI library and how to compile/run MPI jobs on Sapelo2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scheduled Sessions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Using Sapelo2 Cluster at the GACRC, Part II&lt;br /&gt;
|April 17th, Friday, 1:00 - 3:00 PM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Installing Software Packages in Virtual Environments on Sapelo2 ===&lt;br /&gt;
This workshop will cover the basics of virtual environments as well as provide practical guidance and best practices for using virtual environments on the Sapelo2 cluster. Participants will learn the basics of creating and configuring virtual environments, how to install software packages in both a Conda virtual environment and a Python virtual environment, and manage dependencies in their environments.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Must already have strong understanding of the Linux environment and Sapelo2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Learn how to create a virtual environment on Sapelo2  &lt;br /&gt;
&lt;br /&gt;
2. Be able to install software packages into both Conda and Python virtual environments&lt;br /&gt;
&lt;br /&gt;
3. Understand how to manage dependencies of their virtual environments&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scheduled Sessions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Installing Software Packages in Virtual Environments on Sapelo2&lt;br /&gt;
|April 23rd, Thursday, 2:00 - 3:00 PM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Job Parallelization with GNU Parallel and Slurm Arrays ===&lt;br /&gt;
Learn how to run multiple commands in parallel using GNU Parallel and Slurm Arrays. These tools greatly reduce the runtime of certain types of jobs by running multiple instances of the same command in parallel. The workshop focuses on problems that involve executing the same command on multiple different inputs. This workshop is intended for users comfortable writing job submission scripts and using a command line. Concurrent and parallel programming techniques are not covered in this workshop.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Must already have strong understanding of the Linux environment and Sapelo2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Understand which jobs benefit from GNU Parallel and Slurm Arrays&lt;br /&gt;
&lt;br /&gt;
2. Use GNU Parallel and Slurm Arrays to parallelize jobs&lt;br /&gt;
&lt;br /&gt;
3. Understand the differences and similarities between GNU Parallel and Slurm Arrays &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scheduled Sessions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Job Parallelization with GNU Parallel and Slurm Arrays&lt;br /&gt;
|April 30th, Thursday, 1:00 - 2:30 PM&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
===Python Basics===&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; No prerequisites&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Understand Python scientific modules and distributions&lt;br /&gt;
&lt;br /&gt;
2. Understand Python general lexical conventions; Python built-in data types, like string, list, tuple, dictionary, etc.&lt;br /&gt;
&lt;br /&gt;
3. Understand Python programming structures and procedural programming using functions&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Python Basics I||Not scheduled&lt;br /&gt;
|-&lt;br /&gt;
| Python Basics II||Not scheduled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== R Basics===&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; No prerequisites&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Understand fundamentals of R language, e.g. R general lexical conventions, data types, functions, and packages. Part 2 will introduce loops and functions.&lt;br /&gt;
&lt;br /&gt;
2. Be able to manipulate and create data frames using built in functions and the dplyr package.&lt;br /&gt;
&lt;br /&gt;
3. Interact with your file system and submit R code as a batch job to Sapelo 2.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time &lt;br /&gt;
|-&lt;br /&gt;
|R Basics I||Not scheduled&lt;br /&gt;
|-&lt;br /&gt;
|R Basics II||Not scheduled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Conda===&lt;br /&gt;
&#039;&#039;&#039;Prerequisite:&#039;&#039;&#039; No prerequisites&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Training Goals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Understand fundamentals of conda environment&lt;br /&gt;
&lt;br /&gt;
2. Use conda to create and configure your own virtual environments&lt;br /&gt;
&lt;br /&gt;
3. Activate your environments to run python apps from your home directory on Sapelo2&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Title&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Date/Time&lt;br /&gt;
|-&lt;br /&gt;
|Conda Basics ||Not scheduled&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How to Register==&lt;br /&gt;
&lt;br /&gt;
The training workshops &#039;&#039;&#039;Using Sapelo2 Cluster at the GACRC&#039;&#039;&#039; and &#039;&#039;&#039;Use Linux on Cluster&#039;&#039;&#039; are &#039;&#039;&#039;ONLY&#039;&#039;&#039; offered to &#039;&#039;&#039;new users&#039;&#039;&#039; who need user accounts on the GACRC Sapelo2 cluster or current Sapelo2 users seeking a refresher. If you would like to use the cluster, please ask your group PI/UGA faculty member to send us an account creation request for you, using the  [https://uga.teamdynamix.com/TDClient/Requests/ServiceDet?ID=25839  GACRC User Account Request Form].&lt;br /&gt;
 &lt;br /&gt;
If you would like to attend the &#039;&#039;&#039;Using Sapelo2 Cluster at the GACRC, Part II&#039;&#039;&#039;, the &#039;&#039;&#039;Installing Software Packages in Virtual Environments on Sapelo2&#039;&#039;&#039;, and/or the &#039;&#039;&#039;Job Parallelization with GNU Parallel and Slurm Arrays&#039;&#039;&#039; training workshops, please send us a request using the [https://uga.teamdynamix.com/TDClient/Requests/ServiceDet?ID=25852 GACRC Training Request Form]. In your request, please tell us which session(s) you would like to attend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==Topic Introduction==&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Sap2test cluster migration training&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus:  Slurm queueing system, including Slurm job commands, job environment variables, and job submission headers, etc.&lt;br /&gt;
&lt;br /&gt;
The new software environment on Sap2test&lt;br /&gt;
&lt;br /&gt;
Other important topics related to Sap2test working environment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Using Sapelo2 Cluster at the GACRC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Sapelo2 HPC cluster and computational batch job submission workflow&lt;br /&gt;
&lt;br /&gt;
Cluster&#039;s storage environment&lt;br /&gt;
&lt;br /&gt;
Computational queues on cluster&lt;br /&gt;
&lt;br /&gt;
Software environment&lt;br /&gt;
&lt;br /&gt;
How to submit computational batch jobs&lt;br /&gt;
&lt;br /&gt;
Other tips and guidelines for users&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Using Sapelo2 Cluster at the GACRC, Part II&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: More topics on how to use Sapelo2 cluster&lt;br /&gt;
&lt;br /&gt;
Learn about high-performance computing framework&lt;br /&gt;
&lt;br /&gt;
Why is my job pending? How can I get my job to start sooner? How to find available computing resources on Sapelo2?&lt;br /&gt;
&lt;br /&gt;
How to request computing resources such as nodes, CPU cores, memory, GPU device, etc. to run serial, threaded, MPI, and GPU jobs on Sapelo2? &lt;br /&gt;
&lt;br /&gt;
How can I make my job run more efficiently (through the correct use of software and hardware)?&lt;br /&gt;
&lt;br /&gt;
A quick intro to MPI library and how to compile/run MPI jobs on Sapelo2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Use Linux on Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Linux OS fundamentals&lt;br /&gt;
&lt;br /&gt;
Linux common commands, filesystem, and shell&lt;br /&gt;
&lt;br /&gt;
Linux shell scripting basics&lt;br /&gt;
&lt;br /&gt;
Common Linux utilities, e.g., grep, sed, find, sort, and awk, etc.&lt;br /&gt;
&lt;br /&gt;
Linux Hands-on practice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Python Basics I, II&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus of I: Python language overview, scientific modules and distributions&lt;br /&gt;
&lt;br /&gt;
Python general lexical conventions&lt;br /&gt;
&lt;br /&gt;
Basic built-in data types, like string, list, tuple, dictionary, etc.&lt;br /&gt;
&lt;br /&gt;
Focus of II: Programming structures: control flow and loop&lt;br /&gt;
&lt;br /&gt;
Function: procedural programming with examples, lambda expression, factory function and generator&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;R Basics I, II&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus of I: R language overview,general lexical conventions, data types, functions, and packages.&lt;br /&gt;
&lt;br /&gt;
Basic built-in data types, like string, numeric, list, dataframe etc. Using the dplyr package.&lt;br /&gt;
&lt;br /&gt;
Focus of II: Programming structures: control flow, loops and functions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Python on GACRC Sapelo2 Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Install Python packages/modules in a user&#039;s home directory on Sapelo2 cluster&lt;br /&gt;
&lt;br /&gt;
Python versions installed on Sapelo2&lt;br /&gt;
&lt;br /&gt;
Python environment details on Sapelo2 &lt;br /&gt;
&lt;br /&gt;
How to know a Python package is installed or not on Sapelo2&lt;br /&gt;
&lt;br /&gt;
How to install a Python package in user&#039;s home directory on Sapelo2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Do It Yourself: Using Conda to create and run python environments to suit your computing needs effortlessly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Use conda to create and configure your own python virtual environments; Activate your environments to run python apps from your home directory on Sapelo2&lt;br /&gt;
&lt;br /&gt;
What is Conda and its environment&lt;br /&gt;
&lt;br /&gt;
Conda on Sapelo2&lt;br /&gt;
&lt;br /&gt;
Use conda to create and configure your own python virtual environments&lt;br /&gt;
&lt;br /&gt;
Activate your environments to run python apps from your home directory on Sapelo2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;How to submit and run jobs efficiently and correctly on Sapelo2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Sapelo2 cluster general workflow and correct computing resource requesting&lt;br /&gt;
&lt;br /&gt;
Overview of Sapelo2 cluster with reference tables and operational diagrams&lt;br /&gt;
&lt;br /&gt;
Sapelo2 batch job submission workflow taking global scratch as job working space&lt;br /&gt;
&lt;br /&gt;
How to request computing resources correctly &lt;br /&gt;
&lt;br /&gt;
How to run pipeline tasks and what are advantages/disadvantages of different options&lt;br /&gt;
&lt;br /&gt;
Sapelo2 cluster guideline and practical tips&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;GACRC Storage Environment&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Overview of Linux common commands related to file and folder operations&lt;br /&gt;
&lt;br /&gt;
Overview of the storage environment of zcluster and Sapelo cluster at GACRC&lt;br /&gt;
&lt;br /&gt;
How to transfer data between local and GACRC storage&lt;br /&gt;
&lt;br /&gt;
New file transfer node xfer2 and how to use it to transfer data between zcluster and the new cluster&lt;br /&gt;
&lt;br /&gt;
GACRC suggestions on good practices on GACRC storage, etc;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;NCBI Blast application on sapelo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Introduction to BLAST&lt;br /&gt;
&lt;br /&gt;
BLAST job submission to sapelo&lt;br /&gt;
&lt;br /&gt;
Advantages &amp;amp; Disadvantages: NCBI website vs run at sapelo.&lt;br /&gt;
&lt;br /&gt;
Understand BLAST output&lt;br /&gt;
&lt;br /&gt;
Troubleshooting the BLAST results&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;NGS application overview at GACRC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus: Overview of Bioinformatics software available on HPC clusters at GACRC&lt;br /&gt;
&lt;br /&gt;
It’s a brave new world – NGS and its Applications  &lt;br /&gt;
&lt;br /&gt;
Hardware, Software, Databases available at GACRC&lt;br /&gt;
&lt;br /&gt;
NGS project: Logistics and resource considerations&lt;br /&gt;
&lt;br /&gt;
Best practices, common mistakes, troubleshooting and getting help from GACRC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Title: &#039;&#039;&#039;Perl Language Basics I, II&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Focus of I: Overview of Perl language, &lt;br /&gt;
&lt;br /&gt;
Perl general scripting style&lt;br /&gt;
&lt;br /&gt;
Perl fundamental data types&lt;br /&gt;
&lt;br /&gt;
Focus of II: Program structure: control flow and loop&lt;br /&gt;
&lt;br /&gt;
Perl subroutine&lt;br /&gt;
&lt;br /&gt;
Perl I/O&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Download==&lt;br /&gt;
&lt;br /&gt;
This section provides the slides that we use for our current workshops and material used for several of our past training events and presentations.&lt;br /&gt;
 &lt;br /&gt;
====Sapelo2 Cluster Training====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|[[Media:GACRC_Sapelo2_cluster_new_user_training_workshop_v10.8.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Teaching Cluster Training====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:GACRC-Teaching-cluster-new-user-training-workshop-Spring2026.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Linux Training for New Cluster Users====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Linux_Training_For_New_Users_Of_Cluster_Suchi_04252019.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Installing Software Packages in Virtual Environments on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:GACRC_virtual_environments_training_v1.2.pdf]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Job Parallelization with GNU Parallel and Slurm Arrays====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:GNU_Parallel_and_SLURM_Arrays_v1.1.pdf]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Python Basics====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Python_Language_Basics_I_v5.1.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Python_Language_Basics_II_v5.1.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Python_Basics_v6.1.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====R Basics====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:R Language Basics PowerPoint v2.0.1.pdf|Media:R_Language_Basics_PowerPoint_v2.0.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:R_Language_Basics_Document_v2.0.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:R_Language_Basics_part_2_Powerpoint_v1.0.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:R_Language_Basics_part_2_Document_v1.0.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Perl Basics====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[Media:Perl_Language_Basics_I_Workshop_v1.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
====Sap2test Migration Training====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Migrating_to_Slurm_and_new_software_environment.pdf]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please note:&#039;&#039;&#039; To help users familiarize with Slurm and the test cluster environment, we have prepared some training videos that are available from the &#039;&#039;&#039;GACRC&#039;s Kaltura channel&#039;&#039;&#039; at&lt;br /&gt;
https://kaltura.uga.edu/channel/GACRC/176125031 (login with MyID and password is required).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
====Topical Sessions====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:AI_Resources_on_the_GACRC_Sapelo2_Cluster.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Using_Sapelo2_Cluster_at_the_GACRC_Part_II_Rocky8.pdf]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Using_Conda_on_the_GACRC_Sap2test_cluster_v1.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Blast_Workshop_GACRC_02012017.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Media:Next-Generation_Sequencing_Applications_at_GACRC_10282016.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Out-Reach/In-Class Talk====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable unsortable&amp;quot; width=&amp;quot;100%&amp;quot; border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Dept./Center/Institute&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; |Workshop PDF&lt;br /&gt;
|-&lt;br /&gt;
|GEOG - Spring2026 || In-Class || [[Media:GACRC-Teaching-cluster-new-user-training-workshop-python-Spring2026.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|BCMB8330 - Spring2026 || In-Class || [[Media:GACRC-Teaching-cluster-new-user-training-workshop_bcmb8330_Spring2026.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8601 - Spring2026 || In-Class || [[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8601-Spring2026.pdf]] ; [[Media:Gacrc_handout2026_phys8601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Anthropology Department || Out-Reach || [[Media:GACRC_overview_20251117_Anthropology.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|CSP seminar - Fall 2025|| Out-Reach || [[Media:GACRC_overview_20250819-CSP.pdf]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|-&lt;br /&gt;
|BCMB8330 - Spring2025||In-Class||[[Media:GACRC-Teaching-cluster-new-user-training-workshop_bcmb8330-Spring2025.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8602 - Spring2025||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8602-Spring2025.pdf]] ; [[Media:Gacrc_handout2025_phys8602.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Engineering FYOS - Fall 2024|| In-Class||[[Media:GACRC_overview_20240920-FYOS.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|CSP seminar - Fall 2024||Out-Reach||[[Media:GACRC_overview_20240820-CSP.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|BCMB8330 - Spring2024||In-Class||[[Media:GACRC-Teaching-cluster-new-user-training-workshop_bcmb8330_Spring2024.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS4601/6601 - Spring2024|| In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys4601-Spring2024.pdf]] ; [[Media:Gacrc_handout2024_phys4601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8601 - Spring2024||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8601-Spring2024.pdf]] ; [[Media:Gacrc_handout2024_phys8601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|CSP seminar - Fall 2023||Out-Reach||[[Media:GACRC_overview_20230822-CSP.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|BCMB8330 - Spring2023||In-Class||[[Media:GACRC-Teaching-cluster-new-user-training-workshop_bcmb8330.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS4601/6601 - Spring2023||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys4601.pdf]] ; [[Media:Gacrc_handout2023_phys4601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8602 - Spring2023|| In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8602.pdf]] ; [[Media:Gacrc_handout2023_phys8602.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|ILS GradFIRST course - Fall 2022||Out-Reach||[[Media:GACRC_overview_20220901-ILS.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|FYOS1001 - Fall 2022||Out-Reach||[[Media:High_Performance_Computing_(HPC)_on_GACRC_Sapelo2_Cluster.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|CSP seminar - Fall 2022||Out-Reach||[[Media:GACRC_overview_20220830-CSP.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|CSP seminar - Fall 2022||Out-Reach||[[Media:Compile_and_Run_HPC_code_on_Sapelo2.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Terry College IT - Spring2022||Out-Reach ||[[Media:GACRC_overview_20220506-Terry.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8601 - Spring2022||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS4601/6601 - Spring2022||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys4601.pdf]] ; [[Media:Gacrc_handout2021_phys4601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|PHYS8602 - Spring2021 ||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8602-2021.pdf]] ; [[Media:Gacrc_handout2021_phys8602.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|GENE4220 - Fall2020||In-Class||[[Media:GACRC_Teaching_cluster_new_user_training_workshop_GENE4220_Fall2020.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|College of Veterinary Medicine - Spring2020||Out-Reach (jlslab)||[[Media:Using_GACRC_Sapelo2_Cluster-Advanced_Topics(1).pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Byod Data Center - Fall2019||In-Class (FYOS1001)||[[Media:High_Performance_Computing_(HPC)_on_Cluster.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Department of Linguistics - Fall2019||In-class (LING6570)|| [[Media:GACRC_Teaching_cluster_new_user_training_workshop_LING6570_Part2.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Center for Simulational Physics - Fall2019||Out-Reach (Seminar Talk 20190820)||[[Media:Introduction_to_GACRC_Computing_Facility_-_Sapelo2_Cluster_CSP-Fall2019.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Center for Simulational Physics||In-Class (PHYS4601/6601)||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys4601.pdf]] [[Media:Gacrc_handout2019_phys4601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
| The Center for Simulational Physics||In-Class (PHYS8601)||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8601.pdf]] [[Media:Gacrc_handout2020_phys8601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Center for Simulational Physics||In-Class (PHYS8602)||[[Media:GACRC_Teaching_cluster_new_user_training_workshop-phys8602.pdf]] [[Media:Gacrc_handout2019_phys8602.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Food Science - Fall2018||In-Class (FYOS1001)||[[Media:High_Performance_Computing_(HPC)_on_Sapelo2_Cluster_at_GACRC.pdf]]&lt;br /&gt;
|- &lt;br /&gt;
|The Center for Simulational Physics - Summer2018||Out-Reach (Seminar Talk 20180821)||[[Media:Introduction_to_GACRC_Sapelo2_cluster.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Miller plant science - Summer2018||Out-Reach (jlmlab)||[[Media:Introduction_to_GACRC_Sapelo2_cluster.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Biochemistry and Molecular Biology - Spring2018||In-Class (BCMB8330)||[[Media:GACRC_zcluster_Class_Training_BCMB8330_Spring_2018.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Center for Simulational Physics - Summer2017||Out-Reach (Seminar Talk 20170831)||[[Media:Introduction_on_HPC_Resources_at_the_GACRC.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Computational Physics - Spring2017 ||In-class (PHYS4601/6601)||[[Media:Phys4601.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Computational Physics - Spring2017||In-class (PHYS8602)||[[Media:Phys8602.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Institute of Bioinformatics and the Quantitative Biology Consulting Group||Out-Reach||[[Media:Introduction_to_HPC_Resources_at_GACRC_BBB_Talk_20151014.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|The Center for Simulational Physics||Out-Reach (Seminar Talk 20160906)||[[Media:Introduction_to_Sapelo_Computing_Resources_at_GACRC_Workshop20160906.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Microbiology||In-Class (MIBO8150)||[[Media:Introduction_to_HPC_Resources_at_GACRC_MIBO8150_20160926.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Statistics||In-Class (STAT8060)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_Workshop_STAT8060_20150826.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Biochemistry and Molecular Biology||In-Class (BCMB8211)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_BCMB8211_20160114.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Plant Biology||In-Class (PBIO/BINF8350)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_PBIO-BINF8350_20160115.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Plant Biology - Bioinformatics Applications Fall2016||In-Class (PBIO4550)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_PBIO_4550_08182016.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Bioinformatics - Essential Computing Skills for Biologists Fall2016||In-Class (BINF4005)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_BINF_4005_08312016.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Computers in Experimental Genetics Fall2016||In-Class (GENE4220)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_GENE_4220_10192016.pdf]]&lt;br /&gt;
|-&lt;br /&gt;
|Statistics - Advanced Applications and Computing in R Fall2016||In-Class (STAT8330)||[[Media:Introduction_to_HPC_Using_zcluster_at_GACRC_STAT8330_11022016.pdf]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; The slides may become outdated and you should always check GACRC Wiki for up to date information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==Past Sessions==&lt;br /&gt;
&lt;br /&gt;
[[Pass Sessions in 2021]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2020]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2019]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2018]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2017]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2016]]&lt;br /&gt;
&lt;br /&gt;
[[Past Sessions in 2015]]&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22948</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22948"/>
		<updated>2026-04-20T18:47:40Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 1. Prepare a batch job submission script for VSCode tunnel session */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Computing resources (CPU, memory, GPU) allocated here will be available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
# Computing resources (CPU, memory, GPU) allocated for your batch job will be available within your VSCode tunnel working environment.&lt;br /&gt;
# You can load additional compatible central modules in your batch job submission script. Any modules loaded for your batch job will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel (interactive or batch job) is running on a compute node, you can check the related VS Code processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To compare, run the same command on the login node where you started the interactive job or submitted the batch job:&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pgrep -u $USER -af &amp;quot;code|vscode|node&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
3064679 code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir /home/zhuofei/.code_tunnel --accept-server-license-terms&lt;br /&gt;
3064696 sh /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/bin/code-server --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064700 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/server-main.js --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064724 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=fileWatcher&lt;br /&gt;
3064815 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node --dns-result-order=ipv4first /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false&lt;br /&gt;
3064832 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=ptyHost --logsPath /home/zhuofei/.vscode-server/data/logs/20260420T110646&lt;br /&gt;
3064843 /bin/bash --init-file /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pgrep -u $USER -af &#039;code|vscode|node&#039;&lt;br /&gt;
# (no output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Observed Behavior ====&lt;br /&gt;
&#039;&#039;&#039;On compute node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* VS Code Server process (&amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Node runtime processes (shown as &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Extension host (&amp;lt;code&amp;gt;node ... --type=extensionHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
* File watcher (&amp;lt;code&amp;gt;node ... --type=fileWatcher&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Terminal backend (&amp;lt;code&amp;gt;node ... --type=ptyHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On login node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No VSCode-related processes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
* VSCode backend processes run only on the compute node&lt;br /&gt;
* No VSCode services remain on the login node&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
&lt;br /&gt;
* The VSCode workload is fully isolated to the compute node&lt;br /&gt;
* Login nodes remain clean and responsive&lt;br /&gt;
* This behavior aligns with HPC best practices&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
&lt;br /&gt;
* Always run VSCode (server/tunnel) inside a Slurm interactive or batch job on a compute node.&lt;br /&gt;
* Never run VSCode directly on login nodes.&lt;br /&gt;
* Request appropriate CPU, memory, and GPU resources for your workload.&lt;br /&gt;
* Install only the extensions you need.&lt;br /&gt;
* Periodically remove unused extensions to reduce resource usage.&lt;br /&gt;
* Avoid leaving idle VSCode sessions running; terminate jobs when not in use.&lt;br /&gt;
* VS Code and its extensions are installed under ${HOME}/.vscode-server/, which counts toward your home directory quota.&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22947</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22947"/>
		<updated>2026-04-20T18:46:17Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 1. Prepare a batch job submission script for VSCode tunnel session */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Computing resources (CPU, memory, GPU) allocated here will be available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
# Computing resources (CPU, memory, GPU) allocated for your batch job will be available within your VSCode tunnel working environment.&lt;br /&gt;
# You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel (interactive or batch job) is running on a compute node, you can check the related VS Code processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To compare, run the same command on the login node where you started the interactive job or submitted the batch job:&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pgrep -u $USER -af &amp;quot;code|vscode|node&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
3064679 code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir /home/zhuofei/.code_tunnel --accept-server-license-terms&lt;br /&gt;
3064696 sh /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/bin/code-server --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064700 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/server-main.js --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064724 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=fileWatcher&lt;br /&gt;
3064815 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node --dns-result-order=ipv4first /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false&lt;br /&gt;
3064832 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=ptyHost --logsPath /home/zhuofei/.vscode-server/data/logs/20260420T110646&lt;br /&gt;
3064843 /bin/bash --init-file /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pgrep -u $USER -af &#039;code|vscode|node&#039;&lt;br /&gt;
# (no output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Observed Behavior ====&lt;br /&gt;
&#039;&#039;&#039;On compute node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* VS Code Server process (&amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Node runtime processes (shown as &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Extension host (&amp;lt;code&amp;gt;node ... --type=extensionHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
* File watcher (&amp;lt;code&amp;gt;node ... --type=fileWatcher&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Terminal backend (&amp;lt;code&amp;gt;node ... --type=ptyHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On login node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No VSCode-related processes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
* VSCode backend processes run only on the compute node&lt;br /&gt;
* No VSCode services remain on the login node&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
&lt;br /&gt;
* The VSCode workload is fully isolated to the compute node&lt;br /&gt;
* Login nodes remain clean and responsive&lt;br /&gt;
* This behavior aligns with HPC best practices&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
&lt;br /&gt;
* Always run VSCode (server/tunnel) inside a Slurm interactive or batch job on a compute node.&lt;br /&gt;
* Never run VSCode directly on login nodes.&lt;br /&gt;
* Request appropriate CPU, memory, and GPU resources for your workload.&lt;br /&gt;
* Install only the extensions you need.&lt;br /&gt;
* Periodically remove unused extensions to reduce resource usage.&lt;br /&gt;
* Avoid leaving idle VSCode sessions running; terminate jobs when not in use.&lt;br /&gt;
* VS Code and its extensions are installed under ${HOME}/.vscode-server/, which counts toward your home directory quota.&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22946</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22946"/>
		<updated>2026-04-20T18:44:43Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Computing resources (CPU, memory, GPU) allocated here will be available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel (interactive or batch job) is running on a compute node, you can check the related VS Code processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To compare, run the same command on the login node where you started the interactive job or submitted the batch job:&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pgrep -u $USER -af &amp;quot;code|vscode|node&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
3064679 code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir /home/zhuofei/.code_tunnel --accept-server-license-terms&lt;br /&gt;
3064696 sh /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/bin/code-server --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064700 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/server-main.js --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064724 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=fileWatcher&lt;br /&gt;
3064815 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node --dns-result-order=ipv4first /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false&lt;br /&gt;
3064832 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=ptyHost --logsPath /home/zhuofei/.vscode-server/data/logs/20260420T110646&lt;br /&gt;
3064843 /bin/bash --init-file /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pgrep -u $USER -af &#039;code|vscode|node&#039;&lt;br /&gt;
# (no output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Observed Behavior ====&lt;br /&gt;
&#039;&#039;&#039;On compute node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* VS Code Server process (&amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Node runtime processes (shown as &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Extension host (&amp;lt;code&amp;gt;node ... --type=extensionHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
* File watcher (&amp;lt;code&amp;gt;node ... --type=fileWatcher&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Terminal backend (&amp;lt;code&amp;gt;node ... --type=ptyHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On login node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No VSCode-related processes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
* VSCode backend processes run only on the compute node&lt;br /&gt;
* No VSCode services remain on the login node&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
&lt;br /&gt;
* The VSCode workload is fully isolated to the compute node&lt;br /&gt;
* Login nodes remain clean and responsive&lt;br /&gt;
* This behavior aligns with HPC best practices&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
&lt;br /&gt;
* Always run VSCode (server/tunnel) inside a Slurm interactive or batch job on a compute node.&lt;br /&gt;
* Never run VSCode directly on login nodes.&lt;br /&gt;
* Request appropriate CPU, memory, and GPU resources for your workload.&lt;br /&gt;
* Install only the extensions you need.&lt;br /&gt;
* Periodically remove unused extensions to reduce resource usage.&lt;br /&gt;
* Avoid leaving idle VSCode sessions running; terminate jobs when not in use.&lt;br /&gt;
* VS Code and its extensions are installed under ${HOME}/.vscode-server/, which counts toward your home directory quota.&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22945</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22945"/>
		<updated>2026-04-20T18:34:59Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Interpretation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel (interactive or batch job) is running on a compute node, you can check the related VS Code processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To compare, run the same command on the login node where you started the interactive job or submitted the batch job:&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pgrep -u $USER -af &amp;quot;code|vscode|node&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
3064679 code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir /home/zhuofei/.code_tunnel --accept-server-license-terms&lt;br /&gt;
3064696 sh /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/bin/code-server --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064700 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/server-main.js --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064724 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=fileWatcher&lt;br /&gt;
3064815 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node --dns-result-order=ipv4first /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false&lt;br /&gt;
3064832 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=ptyHost --logsPath /home/zhuofei/.vscode-server/data/logs/20260420T110646&lt;br /&gt;
3064843 /bin/bash --init-file /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pgrep -u $USER -af &#039;code|vscode|node&#039;&lt;br /&gt;
# (no output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Observed Behavior ====&lt;br /&gt;
&#039;&#039;&#039;On compute node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* VS Code Server process (&amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Node runtime processes (shown as &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Extension host (&amp;lt;code&amp;gt;node ... --type=extensionHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
* File watcher (&amp;lt;code&amp;gt;node ... --type=fileWatcher&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Terminal backend (&amp;lt;code&amp;gt;node ... --type=ptyHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On login node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No VSCode-related processes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
* VSCode backend processes run only on the compute node&lt;br /&gt;
* No VSCode services remain on the login node&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
&lt;br /&gt;
* The VSCode workload is fully isolated to the compute node&lt;br /&gt;
* Login nodes remain clean and responsive&lt;br /&gt;
* This behavior aligns with HPC best practices&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
&lt;br /&gt;
* Always run VSCode (server/tunnel) inside a Slurm interactive or batch job on a compute node.&lt;br /&gt;
* Never run VSCode directly on login nodes.&lt;br /&gt;
* Request appropriate CPU, memory, and GPU resources for your workload.&lt;br /&gt;
* Install only the extensions you need.&lt;br /&gt;
* Periodically remove unused extensions to reduce resource usage.&lt;br /&gt;
* Avoid leaving idle VSCode sessions running; terminate jobs when not in use.&lt;br /&gt;
* VS Code and its extensions are installed under ${HOME}/.vscode-server/, which counts toward your home directory quota.&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22944</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22944"/>
		<updated>2026-04-20T18:22:40Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel (interactive or batch job) is running on a compute node, you can check the related VS Code processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;To compare, run the same command on the login node where you started the interactive job or submitted the batch job:&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
pgrep -u $USER -af &amp;quot;code|vscode|node&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node&#039;&amp;quot;&lt;br /&gt;
3064679 code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir /home/zhuofei/.code_tunnel --accept-server-license-terms&lt;br /&gt;
3064696 sh /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/bin/code-server --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064700 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/server-main.js --connection-token=j2x9Z0dD03TwZ5WpnxGpodje1UFflxwsjGy0uDjVIOA --accept-server-license-terms --start-server --enable-remote-auto-shutdown --socket-path=/tmp/code-6ca97adf-e1a0-4b74-a319-bd3dff74b07c&lt;br /&gt;
3064724 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=fileWatcher&lt;br /&gt;
3064815 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node --dns-result-order=ipv4first /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=false&lt;br /&gt;
3064832 /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/node /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/bootstrap-fork --type=ptyHost --logsPath /home/zhuofei/.vscode-server/data/logs/20260420T110646&lt;br /&gt;
3064843 /bin/bash --init-file /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pgrep -u $USER -af &#039;code|vscode|node&#039;&lt;br /&gt;
# (no output)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Observed Behavior ====&lt;br /&gt;
&#039;&#039;&#039;On compute node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* VS Code Server process (&amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Node runtime processes (shown as &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Extension host (&amp;lt;code&amp;gt;node ... --type=extensionHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
* File watcher (&amp;lt;code&amp;gt;node ... --type=fileWatcher&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Terminal backend (&amp;lt;code&amp;gt;node ... --type=ptyHost&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On login node:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* No VSCode-related processes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
&lt;br /&gt;
* VSCode backend processes run only on the compute node&lt;br /&gt;
* No VSCode services remain on the login node&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
&lt;br /&gt;
* The VSCode workload is fully isolated to the compute node&lt;br /&gt;
* Login nodes remain clean and responsive&lt;br /&gt;
* This behavior aligns with HPC best practices&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22943</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22943"/>
		<updated>2026-04-20T16:25:32Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
When your VSCode tunnel interactive or batch job is running on a compute node, you can check relevant VSCode processes with:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh &amp;lt;node&amp;gt; &amp;quot;pgrep -u $USER -af &#039;code|vscode|node|python&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ssh ra5-6 &amp;quot;pgrep -u $USER -af &#039;code|vscode|node|python&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For comparing, you can also run the same pgrep on the login node where you started the interactive job or submitted compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system. It must be treated like a compute workload—not a simple SSH tool or text editor.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22942</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22942"/>
		<updated>2026-04-20T16:04:02Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login in Step 5 was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code provided (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22941</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22941"/>
		<updated>2026-04-20T16:00:29Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&#039;&#039;&#039;Important Notes:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* If another authorization prompt appears, it means the previous login was not fully completed.&lt;br /&gt;
* Complete authorization using the latest code shown in the log (for example: &amp;lt;code&amp;gt;E1F9-D7E8&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Once authorization is successful, the VSCode link will appear in the log and can be used directly.&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22940</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22940"/>
		<updated>2026-04-20T15:41:57Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 5. Example of steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&lt;br /&gt;
# --- Next Steps ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown in a browser ---&lt;br /&gt;
# --- 3. Return and run `cat log` again to see new instructions at the bottom of the log ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VS Code tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open a browser and complete authorization using the code shown below ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If this authorization message appears again and you have NOT completed login, complete it in a browser using the latest code shown ---&lt;br /&gt;
# --- If you have already completed authorization, ignore this message and continue ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link in your browser ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear ---&lt;br /&gt;
# --- No action needed if authorization is already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure your browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in your browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22939</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22939"/>
		<updated>2026-04-20T15:26:57Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 5. Example of steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44594144&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44594144      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra5-6               &lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
log.44594144.out  sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# --- IMPORTANT WORKFLOW ---&lt;br /&gt;
# --- 1. Run `cat log` ---&lt;br /&gt;
# --- 2. Follow the instructions shown (usually in browser) ---&lt;br /&gt;
# --- 3. Return and run `cat log` again ---&lt;br /&gt;
# --- 4. Repeat until tunnel is fully ready ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel requests GitHub device authentication ---&lt;br /&gt;
# --- ACTION: Open browser and complete authorization ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- After completing the step above, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Previous step has been completed ---&lt;br /&gt;
# --- Continue following instructions from the log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
# --- ACTION ---&lt;br /&gt;
# --- If prompted again, complete authorization in browser before continuing ---&lt;br /&gt;
# --- If already authorized, proceed to next step ---&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel provides browser access link ---&lt;br /&gt;
# --- ACTION: Open this link on your local machine ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After opening the link, return and continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still appear (normal behavior) ---&lt;br /&gt;
# --- No action needed if already completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel link remains active ---&lt;br /&gt;
# --- ACTION: Ensure browser is connected using the link above ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- After confirming connection, continue ---&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44594144.out &lt;br /&gt;
&lt;br /&gt;
# --- Final stage: client connects to tunnel ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code D9D8-6303&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-20 11:06:45] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] wrote id&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is active ---&lt;br /&gt;
[2026-04-20 11:06:45] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/log.txt and /home/zhuofei/.code_tunnel/servers/Stable-560a9dba96f961efea7b1612916f89e5d5d4d679/pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- Starts new server if none exists ---&lt;br /&gt;
[2026-04-20 11:06:45] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-20 11:06:46] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- DONE: Tunnel is fully ready ---&lt;br /&gt;
# --- You can now use VS Code in browser ---&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22938</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22938"/>
		<updated>2026-04-20T14:11:40Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8           &lt;br /&gt;
    &lt;br /&gt;
zhuofei@ss-sub1 VSCode_tunnel$ ls&lt;br /&gt;
log.44588780.out  sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out&lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
cat log.44572045.out&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
[2026-04-20 09:50:11] info Using GitHub for authentication, run `code tunnel user login --provider &amp;lt;provider&amp;gt;` option to change this.&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code 2DDE-E787&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file fourth time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22937</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22937"/>
		<updated>2026-04-20T14:02:52Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 3. How to  complete Steps 5–7 from the interactive workflow described above. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., log.44588780.out). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8           &lt;br /&gt;
    &lt;br /&gt;
zhuofei@ss-sub1 VSCode_tunnel$ ls&lt;br /&gt;
log.44588780.out  sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out&lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cat log.44572045.out&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
[2026-04-20 09:50:11] info Using GitHub for authentication, run `code tunnel user login --provider &amp;lt;provider&amp;gt;` option to change this.&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code 2DDE-E787&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22936</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22936"/>
		<updated>2026-04-17T20:55:08Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260417 4:53PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22935</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22935"/>
		<updated>2026-04-17T20:52:26Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 4. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the batch job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the batch job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22934</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22934"/>
		<updated>2026-04-17T20:50:29Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 4, Example of steps: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
&lt;br /&gt;
==== 5. Example of steps ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22933</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22933"/>
		<updated>2026-04-17T20:48:56Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Prepare a batch job submission script for VSCode tunnel session ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
==== 2. Submit a batch job ====&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3. How to  complete Steps 5–7 from the interactive workflow described above. ====&lt;br /&gt;
Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above.    &lt;br /&gt;
&lt;br /&gt;
==== 4, Example of steps: ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22932</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22932"/>
		<updated>2026-04-17T20:36:32Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* What Happens Under the Hood When Using VSCode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode directly on login nodes&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&lt;br /&gt;
&lt;br /&gt;
=== Final Note ===&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22931</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22931"/>
		<updated>2026-04-17T20:29:14Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connect */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22930</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22930"/>
		<updated>2026-04-17T20:28:25Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== 9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster? ====&lt;br /&gt;
&lt;br /&gt;
==== If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session. ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in a batch GPU Job ===&lt;br /&gt;
&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22929</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22929"/>
		<updated>2026-04-17T20:26:15Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
==== &#039;&#039;&#039;9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster?&#039;&#039;&#039; ====&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22928</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22928"/>
		<updated>2026-04-17T20:24:57Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
&lt;br /&gt;
=== &#039;&#039;&#039;9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster?&#039;&#039;&#039; ===&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22927</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22927"/>
		<updated>2026-04-17T20:23:56Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&#039;&#039;&#039;9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example of steps described above:   &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ pwd&lt;br /&gt;
/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ ls&lt;br /&gt;
sub.sh&lt;br /&gt;
 &lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat sub.sh &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:1&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sbatch sub.sh &lt;br /&gt;
Submitted batch job 44572045&lt;br /&gt;
&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ sq --me&lt;br /&gt;
JOBID         NAME            PARTITION        USER       NODES  CPUS   MIN_MEMORY   PRIORITY   TIME            TIME_LIMIT      STATE      NODELIST(REASON)    &lt;br /&gt;
44572045      code_tunnel     gpu_p            zhuofei    1      4      32G          996        0:02            4:00:00         RUNNING    ra8-8               &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file first time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- VSCode tunnel is requesting GitHub device authentication ---&lt;br /&gt;
# --- User must open the URL and enter the code to authorize ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file second time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication prompt may still appear until completed ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server initialization message ---&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* By using the software, you agree to&lt;br /&gt;
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and&lt;br /&gt;
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel is ready and provides a browser access link ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
# Open the log file third time&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$ cat log.44572045.out &lt;br /&gt;
&lt;br /&gt;
# --- Authentication message may still be shown in log ---&lt;br /&gt;
To grant access to the server, please log into https://github.com/login/device and use code B578-CB62&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
* Visual Studio Code Server&lt;br /&gt;
*&lt;br /&gt;
* License and privacy information&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
# --- Browser access link (use this on local machine) ---&lt;br /&gt;
Open this link in your browser https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&lt;br /&gt;
&lt;br /&gt;
# --- A client (your browser) connected to the tunnel ---&lt;br /&gt;
[2026-04-17 16:13:13] info [tunnels::connections::relay_tunnel_host] Opened new client on channel 2&lt;br /&gt;
&lt;br /&gt;
# --- Internal SSH handshake between tunnel components ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] wrote id&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] read other id&lt;br /&gt;
&lt;br /&gt;
# --- Tunnel session is now active ---&lt;br /&gt;
[2026-04-17 16:13:13] info [russh::server] session is running&lt;br /&gt;
&lt;br /&gt;
# --- VS Code checks for existing server instance ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Checking /home/zhuofei/.code_tunnel/servers/.../log.txt and pid.txt for a running server...&lt;br /&gt;
&lt;br /&gt;
# --- No running server found, starting a new one ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Starting server...&lt;br /&gt;
&lt;br /&gt;
# --- VS Code Server successfully started ---&lt;br /&gt;
[2026-04-17 16:13:15] info [rpc.0] Server started&lt;br /&gt;
&lt;br /&gt;
# --- Job script finished, tunnel continues running in background ---&lt;br /&gt;
zhuofei@ss-sub4 VSCode_tunnel$&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22926</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22926"/>
		<updated>2026-04-17T18:38:30Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&#039;&#039;&#039;9. What happens if you cancel the interactive job or the job reaches its time limit on the cluster?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you cancel the interactive job, or if the job is terminated after reaching its time limit, the VSCode tunnel session will stop, and all allocated resources (CPU, memory, and GPU) will be released. You will also lose the active VSCode connection and need to start a new session.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example:   &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22925</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22925"/>
		<updated>2026-04-17T18:31:50Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once the job starts running, monitor the job’s standard output log file (e.g., &amp;lt;code&amp;gt;log.44568857.out&amp;lt;/code&amp;gt;). You can use commands such as &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt;to view the log contents from time to time and follow the on-screen instructions to complete Steps 5–7 from the interactive workflow described above. &lt;br /&gt;
&lt;br /&gt;
Below is an example:   &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22924</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22924"/>
		<updated>2026-04-17T13:47:53Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
You can then submit the job to the cluster using:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once job started running, keep monitoring the &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22923</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22923"/>
		<updated>2026-04-17T13:45:45Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
Within the working directory of the interactive job described above, you can use a batch job submission script (&amp;lt;code&amp;gt;sub.sh&amp;lt;/code&amp;gt;) as shown below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
Then submit it to clusters by:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once job started running, keep monitoring the &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22922</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22922"/>
		<updated>2026-04-17T13:44:05Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
In the working folder in the above interactive job, you can use a batch job submission script (sub.sh) as below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in your batch job submission script. Any modules loaded there will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
Then submit it to clusters by:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once job started running, keep monitoring the &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22921</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22921"/>
		<updated>2026-04-17T13:42:20Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
In the working folder in the above interactive job, you can use a batch job script (sub.sh) as below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules in sub.sh. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
&lt;br /&gt;
Then submit it to clusters by:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once job started running, keep monitoring the &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22920</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22920"/>
		<updated>2026-04-17T13:41:26Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Step-by-Step Workflow in a batch GPU Job */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; You can load additional compatible central modules at this step. Any modules loaded here will be configured and available within your VSCode tunnel working environment.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
In the working folder in the above interactive job, you can use a batch job script as below:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=code_tunnel&lt;br /&gt;
#SBATCH --partition=gpu_p&lt;br /&gt;
#SBATCH --gres=gpu:L4:2&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
#SBATCH --ntasks=1&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --mem=32G&lt;br /&gt;
#SBATCH --time=4:00:00&lt;br /&gt;
#SBATCH --output=log.%j.out&lt;br /&gt;
&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&lt;br /&gt;
code-tunnel  tunnel user login --provider github&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Then submit it to clusters by:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
sbatch sub.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Once job started running, keep monitoring the &lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22919</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22919"/>
		<updated>2026-04-17T13:36:20Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Interpretation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
111&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22918</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22918"/>
		<updated>2026-04-17T13:35:54Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* What Happens Under the Hood When Using VSCode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
111&lt;br /&gt;
&lt;br /&gt;
== What Happens Under the Hood When Using VSCode ==&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Extension Behavior ==&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Advantages of This Workflow ==&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Key Takeaway ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22917</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22917"/>
		<updated>2026-04-17T13:34:12Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* What Happens Under the Hood When Using VSCode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Step-by-Step Workflow in a batch GPU Job ==&lt;br /&gt;
111&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22915</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22915"/>
		<updated>2026-04-17T13:23:00Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an [[OnDemand|Open OnDemand]] (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22914</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22914"/>
		<updated>2026-04-16T20:49:52Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Why NOT Use VSCode Remote SSH on Login Nodes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor or a simple SSH tool as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
For this reason, VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes. &#039;&#039;&#039;&#039;&#039;Running VSCode directly on login nodes can result in increased CPU load and memory usage, leading to degraded responsiveness for all users.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an Open OnDemand (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) (To be completed ZH.20260416 4:49PM) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22913</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22913"/>
		<updated>2026-04-16T20:41:53Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* What Happens Under the Hood When Using VSCode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
This is why VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes.&lt;br /&gt;
&lt;br /&gt;
Please keep the following in mind:&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation, either via an interactive job (as shown above), a batch job, or an Open OnDemand (OOD) VSCode session&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22912</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22912"/>
		<updated>2026-04-16T20:37:11Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* Takeaway for Users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
This is why VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Please keep the following in mind:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Always treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation (interactive or batch job)&lt;br /&gt;
* Avoid launching it directly on login nodes, especially when using the SSH Remote extension&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22911</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22911"/>
		<updated>2026-04-16T20:31:01Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* What Happens Under the Hood When Using VSCode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor as many users might expect.&lt;br /&gt;
&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
This is why VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Takeaway for Users ==&lt;br /&gt;
&lt;br /&gt;
* Treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation&lt;br /&gt;
* Avoid launching it directly on login nodes&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22910</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22910"/>
		<updated>2026-04-16T20:30:07Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |714x714px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood When Using VSCode ===&lt;br /&gt;
We would like VSCode users to understand what happens behind the scenes.&lt;br /&gt;
When VSCode starts (via tunnel or SSH remote connection), it launches multiple backend processes, including:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These components work together to provide remote editing, extension support, terminal access, and file system monitoring.&lt;br /&gt;
&lt;br /&gt;
As a result, VSCode behaves much like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, rather than a simple lightweight editor as many users might expect.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Why This Matters ==&lt;br /&gt;
Because of this architecture:&lt;br /&gt;
&lt;br /&gt;
* Multiple background processes are always running&lt;br /&gt;
* CPU and memory are continuously consumed&lt;br /&gt;
* Resource usage persists even when idle&lt;br /&gt;
&lt;br /&gt;
This is why VSCode &#039;&#039;&#039;must be run on compute nodes&#039;&#039;&#039;, not login nodes.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Takeaway for Users ==&lt;br /&gt;
&lt;br /&gt;
* Treat VSCode as a &#039;&#039;&#039;compute workload&#039;&#039;&#039;&lt;br /&gt;
* Always run it inside a Slurm allocation&lt;br /&gt;
* Avoid launching it directly on login nodes&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22909</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22909"/>
		<updated>2026-04-16T20:18:26Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 8. Trust Workspace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Initial connection may take several minutes due to VSCode server download and setup.&lt;br /&gt;
&lt;br /&gt;
* The first time VSCode connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After the server is downloaded and started, VSCode will establish the connection. This process may take several minutes to complete—please be patient.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22908</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22908"/>
		<updated>2026-04-16T20:10:11Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 8. Trust Workspace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|910x910px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The first time Visual Studio Code connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|908x908px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22907</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22907"/>
		<updated>2026-04-16T20:08:06Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 8. Trust Workspace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to VSCode (cloud relay). Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
The VSCode tunnel is now active. Open the provided link in your browser to connect &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
VSCode is now connected through the tunnel (cloud relay).&lt;br /&gt;
[[File:Vscode-tunnel-6.png|none|thumb|600x600px|VSCode is now active]]&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The first time Visual Studio Code connects, it will automatically download the VSCode server (&amp;lt;code&amp;gt;vscode-server-linux-x64.tar.gz&amp;lt;/code&amp;gt;) and temporarily store it in &amp;lt;code&amp;gt;/tmp&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You will also need to click to trust workspace that VSCode will use:&lt;br /&gt;
[[File:Vscode-tunnel-7.png|none|thumb|600x600px|Trust workspace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-7.png&amp;diff=22906</id>
		<title>File:Vscode-tunnel-7.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-7.png&amp;diff=22906"/>
		<updated>2026-04-16T20:07:26Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;vscode tunnel workflow&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-6.png&amp;diff=22905</id>
		<title>File:Vscode-tunnel-6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-6.png&amp;diff=22905"/>
		<updated>2026-04-16T19:56:39Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;vscode tunnel workflow&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22904</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22904"/>
		<updated>2026-04-16T19:53:26Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 7. Open VSCode in your Local Browser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to claud VSCode. Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, following instructions, you will repeat what you did in Step 5:&lt;br /&gt;
&lt;br /&gt;
*Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code generated at this step, for example,  E1F9-D7E8&lt;br /&gt;
* Authorize access&lt;br /&gt;
&lt;br /&gt;
Then open this link in your browser: &amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/&amp;lt;/nowiki&amp;gt;&amp;lt;tunnel-name&amp;gt;/&amp;lt;full&amp;gt;/&amp;lt;path&amp;gt;/&amp;lt;to&amp;gt;/&amp;lt;your&amp;gt;/&amp;lt;working folder where you started tunnel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://vscode.dev/tunnel/vscode-tunnel-0416/scratch/zhuofei/VSCode_tunnel&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
Click:&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22903</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22903"/>
		<updated>2026-04-16T19:45:08Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|600x600px]][[File:Vscode-tunnel-2.png|none|thumb|600x600px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access|513x513px]][[File:Vscode-tunnel-4.png|none|thumb|600x600px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to claud VSCode. Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|1189x1189px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
To grant access to the server, open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; again in your browser and enter the code generated at this step, for example, E1F9-D7E8. You will repeat what you did in Step 5.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
Click:&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22902</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22902"/>
		<updated>2026-04-16T19:32:45Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 6. Start the Tunnel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|400x400px]][[File:Vscode-tunnel-2.png|none|thumb|400x400px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access]][[File:Vscode-tunnel-4.png|none|thumb|400x400px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name &amp;lt;your vscode tunnel name&amp;gt; --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For example:&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel --name vscode-tunnel-0416 --cli-data-dir ~/.code_tunnel --accept-server-license-terms&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;You will be asked how would you like to log in to claud VSCode. Choose GitHub Account.&lt;br /&gt;
[[File:Vscode-tunnel-5.png|none|thumb|400x400px|How would you like to log in to claud VSCode]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in your Local Browser ====&lt;br /&gt;
You will be asked&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
Click:&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 9. Install Extensions (Optional) ====&lt;br /&gt;
Recommended:&lt;br /&gt;
&lt;br /&gt;
* Python&lt;br /&gt;
* Pylance&lt;br /&gt;
* Copilot&lt;br /&gt;
* Container tools&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-5.png&amp;diff=22901</id>
		<title>File:Vscode-tunnel-5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-5.png&amp;diff=22901"/>
		<updated>2026-04-16T19:32:07Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;vscode tunnel workflow&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22900</id>
		<title>Visual Studio Code SSH</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=Visual_Studio_Code_SSH&amp;diff=22900"/>
		<updated>2026-04-16T19:22:04Z</updated>

		<summary type="html">&lt;p&gt;Moses: /* 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Visual Studio Code, or &amp;quot;VS Code&amp;quot;, is a popular code editor.  It is very customizable and allows the user to install many extensions.  &lt;br /&gt;
&lt;br /&gt;
==Correct Usage of VS Code and other IDEs on the Sapelo2 Cluster==&lt;br /&gt;
&lt;br /&gt;
Please keep in mind that if you log in to the Sapelo2 Cluster via VS Code, you will be placed on a &#039;&#039;&#039;login node&#039;&#039;&#039;. This is acceptable only to edit code/files and other low-level tasks, but please do not run code there. It will likely overload our login nodes and cause disruptions to the performance of the login nodes. If you want to run tests in VS Code, please do one of the following first:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Running Code/Tests in VS Code on the Cluster&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Start an interactive job within VS Code after logging in to the Sapelo2 Cluster&lt;br /&gt;
# Use VS Code through On Demand ([[OnDemand|https://wiki.gacrc.uga.edu/wiki/OnDemand]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: Some VS Code extensions run in the background even if you are only editing code when you log in via your own VS Code installation on your computer (not through OnDemand). This can still overload our login nodes and cause significant slowness for users logged in to the same login nodes. To remedy this, you can disable these extensions for remote hosts using the instructions below.&lt;br /&gt;
&lt;br /&gt;
==Disabling Heavy-Hitting Extensions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Disabling extensions using &amp;quot;Disable (remote)&amp;quot; is simple and re-enabling them is also very quick and easy and does not require re-installation. &amp;quot;&#039;&#039;&#039;Disable (remote)&amp;quot; disables your VS Code extensions when on a remote host (like the Sapelo2 Cluster), but still allows you to use them locally.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you log in to the Sapelo2 Cluster via VS Code (not through OnDemand), your enabled extensions may run in the background even if you are only editing code, which will still contribute to the load on the login node. High load on login nodes causes major disruptions in the performance of those nodes for all users logged in to those nodes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following VS Code extensions are some that commonly run in the background even when you are not running code. Please consider disabling them for remote hosts with &amp;quot;Disable (remote)&amp;quot; if you plan to log in to the Sapelo2 Cluster via the VS Code IDE. You can easily and quickly enable the extension when you are ready to run your code on the Sapelo2 Cluster within an interactive job in your VS Code session. &lt;br /&gt;
&lt;br /&gt;
Extensions:&lt;br /&gt;
*C/C++ (ms-vscode.cpptools)&lt;br /&gt;
*Python (ms-python.python)&lt;br /&gt;
*Pylance (ms-python.vscode-pylance)&lt;br /&gt;
*Jupyter (ms-toolsai.jupyter)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot (github.copilot)&lt;br /&gt;
&lt;br /&gt;
* GitHub Copilot Chat (github.copilot-chat)&lt;br /&gt;
* Codeium (codeium.codeium)&lt;br /&gt;
* Claude-related extensions&lt;br /&gt;
* Docker (ms-azuretools.vscode-docker)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Steps to disable extensions for remote hosts using &amp;quot;Disable (remote)&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
#In VS Code, click on the extension panel to view your extensions&lt;br /&gt;
#Click on the gear icon next to the extension that you want to disable&lt;br /&gt;
#Click on &#039;Disable (remote)&#039;&lt;br /&gt;
&lt;br /&gt;
* You can then re-enable your extensions if you need to run tests on the Sapelo2 Cluster by starting an interactive job in your VS Code session and clicking &amp;quot;Enable&amp;quot; on your desired extension&lt;br /&gt;
&lt;br /&gt;
==Downloading VS Code==&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, you can download VS Code [https://code.visualstudio.com/download here].  If you&#039;re using Windows, you&#039;ll almost certainly want to download the 64 bit User Installer.&lt;br /&gt;
&lt;br /&gt;
===Installing the SSH extension===&lt;br /&gt;
Here we will go over how to set up its SSH extension.  This will allow you to have VS Code connect to Sapelo2 so that you can edit files on the cluster with your local instance of VS Code.&lt;br /&gt;
&lt;br /&gt;
====Open the Extensions Interface====&lt;br /&gt;
&lt;br /&gt;
When you open VS Code, you&#039;ll see on the left the Activity Bar, with several buttons displayed vertically.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_activity_bar.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Search for the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Clicking the button with the four squares opens up the extensions interface in the sidebar.  Below you can see some of extensions I already have installed.  Some of these are just simply color theme packages, to change syntax highlighting colors.  Others provide features relevant to a particular programming language, such as the Python extension providing [https://code.visualstudio.com/docs/editor/intellisense#:~:text=IntelliSense%20is%20a%20general%20term,%2C%20and%20%22code%20hinting.%22 IntelliSense] for Python.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_extensions.png | 400px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
At the top of the extensions interface is a search bar, where you can search for official or community-provided extensions.  This is where you could search for the SSH extension, for example.  Typically you&#039;ll want to install extensions provided by a known source, such as Microsoft in this case (the first option), and/or an extension that has many downloads and a high rating, as shown in this search output.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_ssh_extension.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Install the SSH Extension====&lt;br /&gt;
&lt;br /&gt;
Once you find the extension you want, all you have to do is click the small &amp;quot;Install&amp;quot; button in the search output, and a tab will open in your editor with more information and instructions on how to use the extension that you have installed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_installed.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Using the SSH Extension==&lt;br /&gt;
&lt;br /&gt;
===Click the SSH Button===&lt;br /&gt;
&lt;br /&gt;
You can hide the sidebar if you wish with cmd + b on Mac and ctrl + b on Windows.  Once the SSH extension is installed you will see this small greater than &amp;amp; less than button in the bottom left corner of VS Code.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshbutton.png | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Add a new SSH Host Connection====&lt;br /&gt;
&lt;br /&gt;
Upon clicking that small SSH button in the bottom left, a prompt window will appear in the top middle of VS Code, asking how you want to connect to whatever it is you&#039;re going to SSH.  Select the first option, &amp;quot;Connect Current Window to Host...&amp;quot;.  &lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_connection_options.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Next, click the &amp;quot;Add New SSH Host...&amp;quot; option, and type your MyID@sapelo2.gacrc.uga.edu in the prompt, and then press enter.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_new_ssh_host.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_connection.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it asks you what SSH config file to update, you can just choose the first option.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_sshconfig.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Connect to Sapelo2====&lt;br /&gt;
&lt;br /&gt;
The prompt will then disappear, but now you can click the small SSH button in the bottom left of VS Code and see that your connection has been saved, you don&#039;t have to type it every time.  Click the Sapelo2 connection to then be presented with a password prompt.  This just wants your MyID password, as if you were normally connecting to Sapelo2 via PuTTY or your terminal.  Then you will get an ArchPass DUO prompt.  You can respond to this with a 1 for a push notification to your phone, or however you normally authenticate with ArchPass DUO.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_chooseconnection.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_password.png | 600px | frameless]]&lt;br /&gt;
[[File:Vscode_duo.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open Directories on Sapelo2====&lt;br /&gt;
&lt;br /&gt;
Once you approve the connection request via DUO, you&#039;re connected to Sapelo2!  To open up a particular directory on Sapelo2, click the button on the side part that looks like two pieces of paper, which will open the explorer interface within the sidebar.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_explorer.png | 600px | frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Click the &amp;quot;Open Folder&amp;quot; button to then be presented with a prompt where you can enter any path on Sapelo2 to which you have permission to access.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_opendir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In this example, I&#039;ve opened my home directory in the side bar.  It presents it as a file tree that I can navigate graphically.  Directories can be expanded by clicking them.  Files can be opened in VS Code by double clicking them, as you can see here, with this file.txt in my home directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_homedir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can open multiple directories on Sapelo2 in the sidebar of VS Code by clicking the &amp;quot;Add Folder to Workspace&amp;quot; option in the File menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_add_dir.png |700x700px| frameless]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====Open the Terminal in VS Code====&lt;br /&gt;
&lt;br /&gt;
I highly recommend toggling the Terminal in VS Code, which will allow you to interact with Sapelo2 as you normally would from within VS Code.  To do this, click &amp;quot;Terminal&amp;quot; under the View menu.  This will open up a terminal in the bottom half of the editor.  You can enter any command as you normally would on Sapelo2.&lt;br /&gt;
&lt;br /&gt;
[[File:Vscode_terminal.png |816x816px| frameless ]]&lt;br /&gt;
&lt;br /&gt;
== VSCode Tunnel Workflow on Sapelo2 (GPU Nodes) ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
This guide describes how to run VSCode on Sapelo2 compute nodes using a tunnel-based workflow.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
Using VSCode Remote SSH directly from a local machine often:&lt;br /&gt;
&lt;br /&gt;
* Launches backend services on &#039;&#039;&#039;login nodes&#039;&#039;&#039;&lt;br /&gt;
* Causes &#039;&#039;&#039;CPU and memory contention&#039;&#039;&#039; on login nodes&lt;br /&gt;
* Leads to degraded performance for all users&lt;br /&gt;
&lt;br /&gt;
This workflow ensures:&lt;br /&gt;
&lt;br /&gt;
* All VSCode processes run inside a &#039;&#039;&#039;Slurm interactive or batch job&#039;&#039;&#039;&lt;br /&gt;
* Proper resource allocation (CPU / memory / GPU)&lt;br /&gt;
* No persistent processes on login nodes&lt;br /&gt;
&lt;br /&gt;
=== Workflow architecture ===&lt;br /&gt;
Local Browser (vscode.dev)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Tunnel (cloud relay)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
Compute Node (Slurm job on gpu_p)&lt;br /&gt;
&lt;br /&gt;
                ↓&lt;br /&gt;
&lt;br /&gt;
VSCode Server + Extensions + User Workload&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step Workflow in an Interactive GPU Job ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Allocate a GPU Interactive Job ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
interact -c 20 --mem 80gb -p gpu_p --gres gpu:L4:2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 2. Clean Previous VSCode State (Recommended. Note that all VSCode extensions you downloaded will be removed) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
rm -rf ~/.vscode&lt;br /&gt;
rm -rf ~/.vscode-server&lt;br /&gt;
rm -rf ~/.code_tunnel&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 3. Prepare Working Directory ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd /scratch/$USER/VSCode_tunnel/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 4. Load VSCode Module ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
ml VSCode/1.88.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 5. Authenticate VSCode Tunnel (You need a GitHub personal account to complete this step) ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
code-tunnel tunnel user login --provider github&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Follow the instructions in your local web browser:&lt;br /&gt;
&lt;br /&gt;
* Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt; , choose to use your personal GitHub account.&lt;br /&gt;
* Enter the code, for example, 15C1-6D7C&lt;br /&gt;
* Authorize access[[File:Vscode-tunnel-1.png|thumb|Open &amp;lt;nowiki&amp;gt;https://github.com/login/device&amp;lt;/nowiki&amp;gt;|none|400x400px]][[File:Vscode-tunnel-2.png|none|thumb|400x400px|Enter the code]][[File:Vscode-tunnel-3.png|none|thumb|Authorize access]][[File:Vscode-tunnel-4.png|none|thumb|400x400px|Authorization successful]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 6. Start the Tunnel ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 7. Open VSCode in Browser ====&lt;br /&gt;
Open the generated link:&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 8. Trust Workspace ====&lt;br /&gt;
Click:&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== 9. Install Extensions (Optional) ====&lt;br /&gt;
Recommended:&lt;br /&gt;
&lt;br /&gt;
* Python&lt;br /&gt;
* Pylance&lt;br /&gt;
* Copilot&lt;br /&gt;
* Container tools&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== What Happens Under the Hood ===&lt;br /&gt;
VSCode launches multiple backend processes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;code-server&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;node (server-main.js)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;extensionHost&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;fileWatcher&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ptyHost&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These behave like a &#039;&#039;&#039;multi-process application server&#039;&#039;&#039;, not a lightweight editor.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Compute Node and Login Node Behavior (Observed) ===&lt;br /&gt;
Example on compute node:&lt;br /&gt;
&lt;br /&gt;
Processes include:&lt;br /&gt;
&lt;br /&gt;
* VSCode server&lt;br /&gt;
* Node.js services&lt;br /&gt;
* Extension hosts&lt;br /&gt;
* Terminal backend&lt;br /&gt;
&lt;br /&gt;
Resource usage example:&lt;br /&gt;
&lt;br /&gt;
* CPU: low but persistent&lt;br /&gt;
* Memory: non-trivial&lt;br /&gt;
* GPU: allocated but may be idle&lt;br /&gt;
* Processes: &amp;lt;code&amp;gt;code-tunnel&amp;lt;/code&amp;gt;, multiple &amp;lt;code&amp;gt;node&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Across all login nodes (&amp;lt;code&amp;gt;ss-sub1&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;ss-sub4&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
==== Result ====&lt;br /&gt;
* No VSCode backend processes present&lt;br /&gt;
* Only Slurm launcher processes visible&lt;br /&gt;
* No persistent services running&lt;br /&gt;
&lt;br /&gt;
==== Interpretation ====&lt;br /&gt;
✔ VSCode workload is fully isolated to compute node&lt;br /&gt;
&lt;br /&gt;
✔ Login nodes remain clean and responsive&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Why NOT Use VSCode Remote SSH on Login Nodes ===&lt;br /&gt;
If users connect directly:&lt;br /&gt;
&lt;br /&gt;
* VSCode server runs on login nodes&lt;br /&gt;
* Multiple Node.js processes are spawned&lt;br /&gt;
* Persistent background services accumulate&lt;br /&gt;
&lt;br /&gt;
=== Impact ===&lt;br /&gt;
&lt;br /&gt;
* Increased CPU load&lt;br /&gt;
* Reduced responsiveness&lt;br /&gt;
* Potential policy violations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Extension Behavior ===&lt;br /&gt;
&lt;br /&gt;
==== Before Python Extension ====&lt;br /&gt;
User extensions:&lt;br /&gt;
&lt;br /&gt;
* Minimal (e.g., Copilot)&lt;br /&gt;
&lt;br /&gt;
Server extensions:&lt;br /&gt;
&lt;br /&gt;
* Built-in only&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== After Python Extension Installation ====&lt;br /&gt;
New extension appears:&lt;br /&gt;
&lt;br /&gt;
==== Key Points ====&lt;br /&gt;
* User extensions → &amp;lt;code&amp;gt;~/.vscode-server/extensions/&amp;lt;/code&amp;gt;&lt;br /&gt;
* Built-in extensions → server directory&lt;br /&gt;
* Server directory remains unchanged&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== HPC Implications ===&lt;br /&gt;
&lt;br /&gt;
==== Storage ====&lt;br /&gt;
* Extensions stored in home directory&lt;br /&gt;
* Can grow over time&lt;br /&gt;
&lt;br /&gt;
==== Performance ====&lt;br /&gt;
Installing extensions (e.g., Python) adds:&lt;br /&gt;
&lt;br /&gt;
* Language servers&lt;br /&gt;
* Background indexing&lt;br /&gt;
* Additional CPU/memory usage&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Best Practices ===&lt;br /&gt;
* Always run inside a Slurm allocation&lt;br /&gt;
* Never run VSCode on login nodes&lt;br /&gt;
* Use &amp;lt;code&amp;gt;/scratch&amp;lt;/code&amp;gt; for active work&lt;br /&gt;
* Install only necessary extensions&lt;br /&gt;
* Clean unused extensions periodically&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Advantages of This Workflow ===&lt;br /&gt;
* Prevents login node overload&lt;br /&gt;
* Enables GPU-based development&lt;br /&gt;
* Supports AI/LLM workflows&lt;br /&gt;
* Works entirely in browser&lt;br /&gt;
* Scales cleanly across users&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Key Takeaway ===&lt;br /&gt;
&amp;lt;blockquote&amp;gt;VSCode is a distributed, multi-process system.&lt;br /&gt;
&lt;br /&gt;
It must be treated like a compute workload—not a simple SSH tool.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Final Note ==&lt;br /&gt;
This workflow is strongly recommended for:&lt;br /&gt;
&lt;br /&gt;
* AI / LLM workloads&lt;br /&gt;
* GPU-based development&lt;br /&gt;
* Heavy interactive coding sessions&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
	<entry>
		<id>https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-4.png&amp;diff=22899</id>
		<title>File:Vscode-tunnel-4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.gacrc.uga.edu/index.php?title=File:Vscode-tunnel-4.png&amp;diff=22899"/>
		<updated>2026-04-16T19:20:52Z</updated>

		<summary type="html">&lt;p&gt;Moses: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;vscode tunnel workflow&lt;/div&gt;</summary>
		<author><name>Moses</name></author>
	</entry>
</feed>