VSCode Remote Server Connection Guide
A comprehensive guide for setting up VSCode to connect to the DOE lab server for remote development.
VSCode Remote Server Connection Guide
This guide will walk you through setting up VSCode to connect to the DOE lab server for remote development, allowing you to code directly on the server from your local machine.
Prerequisites
Before starting, ensure you have:
- VSCode installed on your local machine
- Server access credentials (username, password, domain)
- Wireguard VPN configured and connected
- SSH access to the server
Step 1: Install VSCode Extensions
- Open VSCode on your local machine
- Go to Extensions (Ctrl+Shift+X)
- Search for and install:
- Remote - SSH (by Microsoft)
- Remote - SSH: Editing Configuration Files (by Microsoft)
Step 2: Configure SSH Connection
- Open VSCode Command Palette (Ctrl+Shift+P) or click on the SSH icon in the left sidebar
- Type “Remote-SSH: Connect to Host”
- Select “Add New SSH Host”
- Enter the SSH connection string:
1
ssh username@server-domain
Example:
ssh comp@anthony.doelab.site
- Choose the SSH configuration file location (usually the default)
- VSCode will add the connection to your SSH config
- Enter your password when prompted and wait for VSCode to download on the server.
Step 3: Connect to Server
- Open Command Palette (Ctrl+Shift+P)
- Type “Remote-SSH: Connect to Host”
- Select your configured server from the list
- Choose the platform (Linux)
- Enter your password when prompted
- You will be connected to the server and can start developing and run code with the terminal from VSCode similar to SSH.
Step 4: Access Compute Node
Once connected to the server, you’ll be in the login node. To access a compute node:
- Open a terminal in VSCode (Ctrl+`)
- Run the srun command:
1
srun --pty bash
- Your terminal will now show the compute node name
Step 5: Load Required Modules
On the compute node, load the software modules you need:
1
2
3
module avail # List available modules
module load quartus # Load Quartus (example)
module load questasim # Load QuestaSim (example)
Step 6: Open Project Folder
- In VSCode, go to File → Open Folder
- Navigate to your project directory
- Select the folder to open it in VSCode
Step 7: Development Workflow
File Operations
- Create, edit, and save files directly on the server
- Use VSCode’s file explorer to manage your project structure
- All changes are saved directly on the server
Terminal Usage
- Use the integrated terminal for running commands
- Execute synthesis, simulation, and other tools
- Monitor processes and system resources
Debugging
- Set breakpoints in your code
- Use VSCode’s debugging features
- Monitor variables and program flow
Step 8: Working with Multiple Files
VSCode provides excellent support for working with multiple files:
- Split Editor: Right-click a tab → “Split Editor”
- Side-by-side: Drag tabs to create side-by-side views
- File Explorer: Use the file explorer to navigate your project
Step 9: Extensions and Settings
Install Extensions on Remote
- Go to Extensions (Ctrl+Shift+X)
- Install extensions that will run on the remote server:
- SystemVerilog for HDL support
- Verilog-HDL for Verilog support
- GitLens for Git integration
- Python for Python development
Sync Settings
- VSCode will sync your settings between local and remote
- Customize your development environment as needed
Step 10: File Transfer
Upload Files
- Use VSCode’s file explorer to create new files
- Copy and paste content from your local machine
- Save files directly on the server
Download Files
- Open files in VSCode
- Copy content to your local machine
- Or use FileZilla for bulk transfers
Troubleshooting
Connection Issues
- Ensure Wireguard VPN is connected
- Verify server domain and credentials
- Check SSH configuration
Performance Issues
- Close unnecessary files and tabs
- Use the integrated terminal efficiently
- Monitor server resources with
htop
Extension Problems
- Some extensions may not work on remote servers
- Install extensions that support remote development
- Check extension compatibility
Best Practices
- Regular Saves: Save your work frequently
- Backup: Keep local copies of important files
- Resource Management: Monitor CPU and memory usage
- Clean Sessions: Log out properly when done
- Version Control: Use Git for project management
Quick Commands Reference
| Command | Description | |———|————-| | Ctrl+Shift+P
| Open Command Palette | | Ctrl+
| Open/Close Terminal | |
Ctrl+Shift+X | Open Extensions | |
Ctrl+Shift+F | Search in Files | |
Ctrl+Shift+G` | Open Source Control |
Advanced Features
Remote Development
- Edit files directly on the server
- Run terminal commands remotely
- Debug applications on the server
- Use server resources for compilation
Integrated Terminal
- Multiple terminal sessions
- Split terminal views
- Custom terminal profiles
- Command history
File Synchronization
- Real-time file updates
- Conflict resolution
- Version control integration
- Backup and restore
For more detailed information about VSCode Remote Development, visit the official Microsoft documentation.