6. Remote Development with VS Code
Using VS Code with Remote-SSH is one of the best ways to develop code on Falcon. Instead of editing files in vim and struggling with limited terminal editors, you get the full power of VS Code on your local machine while your code actually runs on Falcon’s supercomputer.
6.1. Why Use Remote-SSH?
Working directly on Falcon using vim or nano has limitations:
Limited editing experience: Terminal editors are powerful but less user-friendly than modern IDEs
No built-in debugging: It’s harder to step through code and inspect variables
No extensions: You miss out on language support, linters, formatters, etc.
Slow feedback loop: Making small changes requires saving, quitting the editor, and retesting
With VS Code Remote-SSH, you get:
Full VS Code features: IntelliSense, syntax highlighting, code completion, refactoring tools
Integrated terminal: Run bash commands on Falcon without leaving VS Code
Debugging: Set breakpoints, inspect variables, step through code in Python, JavaScript, etc.
Extensions: Install linters, formatters, language servers, and productivity tools
Local editing experience: Edit files like you’re on your local machine, but they’re on Falcon
Seamless workflow: Write, test, and debug all in one place
The magic is that VS Code runs a small server on Falcon that communicates with your local VS Code client. You edit locally, but the code executes on Falcon’s powerful hardware.
6.2. Prerequisites
Before starting, make sure you have:
VS Code installed on your local machine (https://code.visualstudio.com/)
SSH access to Falcon (completed the System Access and Logging Into Falcon for the First Time guides)
SSH config set up (configured
~/.ssh/configas shown in Logging Into Falcon for the First Time)VPN access to Cardiff University (required for all Falcon connections)
6.3. Step 1: Install VS Code
If you don’t already have VS Code:
Download the version for your operating system (Windows, macOS, or Linux)
Run the installer and follow the prompts
Launch VS Code
6.4. Step 2: Install the Remote-SSH Extension
Open VS Code
Click the Extensions icon on the left sidebar (it looks like four squares)
Search for “Remote - SSH” (the official one is by Microsoft)
Click Install
The extension should appear in your sidebar as a new icon that looks like a remote connection symbol (><).
6.5. Step 3: Open a Remote-SSH Connection
Quick Method: Using the Command Palette
Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) to open the Command PaletteType “Remote-SSH: Connect to Host…”
Select it
Choose your host (if you’ve set up SSH config, you’ll see “falcon” in the list)
Press Enter
VS Code will connect to Falcon and set up the remote server
If prompted for a password, enter your Falcon password
Alternative Method: Using the Bottom-Left Icon
Click the “><” icon in the bottom-left corner of VS Code
Select “Connect to Host…”
Choose your host from the list
Enter your password if prompted
First Time Connection
The first time you connect, VS Code will:
- Install a server on Falcon (in ~/.vscode-server)
- Download necessary dependencies
- This takes a few minutes but only happens once
You’ll know you’re connected when: - The “><” icon in the bottom-left shows “SSH: falcon” - The explorer sidebar shows your Falcon home directory - The integrated terminal runs commands on Falcon
6.6. Step 4: Open a Project Folder
Once connected to Falcon:
Click File > Open Folder
Navigate to your project folder (e.g.,
/home/yourusername/projects/myproject)Click Select Folder
VS Code will load your project
You can now edit files normally. The files are on Falcon, but you’re editing them with VS Code’s full feature set.
6.7. Using the Integrated Terminal
One of the most useful features is the integrated terminal, which automatically runs commands on Falcon:
Press
Ctrl+`(backtick) or go to Terminal > New TerminalA terminal opens at the bottom of VS Code
Any command you run executes on Falcon
You can type bash commands just like SSH-ing in normally
This is perfect for:
- Running your code: python analysis.py
- Checking job status: squeue -u $USER
- Submitting SLURM jobs: sbatch myjob.sh
- Testing quick commands before making changes
Example Workflow:
Edit your Python script in the editor
Save the file (
Ctrl+S)Open the integrated terminal
Run
python -u analysis.pyto testSee the output in the terminal
Make fixes in the editor
Re-run the command
6.8. VS Code Extensions for Remote Development
Once connected via Remote-SSH, you can install extensions that work on Falcon. Some useful ones:
Python Development - Python (Microsoft): Full Python support with IntelliSense and debugging - Pylance: Advanced Python language support - Ruff: Fast Python linter and formatter
Code Quality - ESLint: JavaScript linting - Prettier: Code formatter - Black Formatter: Python code formatter
General Productivity - GitLens: Git history and blame information - Git Graph: Visualize your Git history - Thunder Client: Make HTTP requests (useful for testing APIs) - SFTP: Upload/download files (though less useful with Remote-SSH)
Installation for Remote Extensions:
Click Extensions in the sidebar
Search for the extension
Click Install on SSH: falcon (or your host)
Some extensions work locally only (they’ll say “Local” when you search), while others work remotely (they’ll say “Remote”).
6.9. Useful Keyboard Shortcuts
Navigation and Editing
Ctrl+P Quick file open (start typing filename)
Ctrl+Shift+P Command palette (search any command)
Ctrl+F Find in file
Ctrl+H Find and replace
Ctrl+D Select next occurrence of word
Ctrl+K Ctrl+F Format document
Terminal
Ctrl+` Toggle integrated terminal
Ctrl+Shift+` New terminal
Remote Connection
Ctrl+Shift+P then "Remote-SSH: Connect to Host" Start remote session
Ctrl+Shift+P then "Remote-SSH: Close Remote" Disconnect from remote
Debugging (if using Python extension)
F5 Start debugging
F9 Toggle breakpoint
F10 Step over
F11 Step into
Shift+F11 Step out
6.10. Common Workflows
Workflow 1: Edit, Test, Debug
Connect to Falcon via Remote-SSH
Open your project folder
Make changes to your code in the editor
Open the integrated terminal (
Ctrl+`)Run your code:
python script.pySee output in the terminal
Set breakpoints by clicking line numbers
Press F5 to debug with stepping
Repeat until fixed
Workflow 2: Submit SLURM Jobs
Connect to Falcon
Edit your job script in VS Code
Open the terminal
Run
sbatch myjob.shMonitor with
squeue -u $USEREdit and resubmit as needed
Workflow 3: Interactive Session Development
Connect to Falcon
Open terminal
Test commands interactively:
python -i script.pyIterate on code in the editor
Re-run with fresh imports
6.11. Troubleshooting
“Failed to authenticate” or password-related errors:
Make sure your VPN is on
Check that your SSH config is correct (see Logging Into Falcon for the First Time)
Try connecting directly:
ssh falconin a local terminal firstYour Falcon password may have expired—check with Omar
“Connection timeout”:
Check your VPN connection
Verify you can SSH normally:
ssh falconTry again after a minute (server might be slow)
“Remote server failed to start”:
Sometimes the
.vscode-serverfolder gets corruptedRun this in your local terminal:
ssh falcon 'rm -rf ~/.vscode-server'Reconnect from VS Code—it will reinstall
Extensions not working on remote:
Some extensions only work locally
Search for the extension and check if it shows “Install on SSH: falcon”
If it only shows “Install”, it’s local-only
Slow performance:
This is usually a network issue, not VS Code
Check your VPN connection
Try the Bash Basics guide to understand system performance
Close unused editor tabs to reduce overhead
Can’t find Falcon in the host list:
Make sure your SSH config is set up (see Logging Into Falcon for the First Time)
You can manually type the host: type “c.sglmn3@falconlogin.cf.ac.uk”
Check that the SSH config file is at
~/.ssh/config
6.12. Tips for Efficient Remote Development
Use integrated terminal: It’s faster than alt-tabbing between terminals
Keep workspace files local: VS Code can sync settings between machines
Use Git for version control: Clone your repo on Falcon and use the built-in Git tools
Set up a .vscode folder: Create
.vscode/settings.jsonin your project for project-specific settingsUse proper Python environments: Activate virtual environments in the terminal before running code
Commit frequently: If something breaks, you can revert
6.13. Example Project Setup
Here’s a recommended folder structure for a project on Falcon:
~/projects/myproject/
├── .vscode/
│ └── settings.json # Project-specific VS Code settings
├── .gitignore
├── README.md
├── data/
│ ├── inputs/ # Input files
│ └── outputs/ # Results
├── src/
│ ├── __init__.py
│ ├── analysis.py
│ └── utils.py
├── scripts/
│ └── process.py
├── job_scripts/
│ ├── job1.sh
│ └── job2.sh
└── results/
└── .gitkeep
Then in VS Code:
1. Open the ~/projects/myproject/ folder
2. Edit files in the src/ folder
3. Use the integrated terminal to run scripts
4. Save results to the results/ folder
5. Commit to Git
6.14. Getting Help
VS Code docs: https://code.visualstudio.com/docs/remote/remote-ssh
Remote-SSH extension guide: In VS Code, click Extensions, find Remote-SSH, view the README
Ask Omar or colleagues: They likely have their own setup
Check the :doc:`loggingin` guide: If you’re having connection issues
With Remote-SSH, you get the best of both worlds: the power of Falcon’s supercomputer and the comfort of VS Code on your local machine.