Skip to main content

VS Code Remote WSL Setup: The Ultimate Linux Development Workflow

·1218 words·6 mins
Vscode Wsl Remote-Development Linux Windows Developer Tools Python Javascript Dev-Environment
Table of Contents

VS Code Remote WSL Setup: The Ultimate Linux Development Workflow

VS Code Remote - WSL is one of the most efficient development environments available for Windows users who rely on Linux tooling. It combines the performance and compatibility of native Linux development with the polished desktop experience of Windows.

Instead of editing files across the Windows/Linux filesystem boundary, VS Code connects directly into the WSL environment. Your editor UI remains native to Windows, while the actual development runtime, terminal, extensions, Git operations, and language servers execute entirely inside Linux.

For experienced developers, this setup significantly improves filesystem performance, tooling consistency, and overall workflow efficiency.


🚀 Why Use VS Code Remote - WSL?
#

Traditional Windows-Centric Workflow
#

The most common anti-pattern is opening Linux files from the Windows filesystem layer:

VS Code (Native Windows)
Editing /mnt/c/project/*.py

→ Cross-filesystem operations
→ Slow file indexing
→ Poor Git performance
→ Inconsistent extension behavior
→ Windows-based terminal environment

This approach introduces heavy filesystem translation overhead between NTFS and the Linux subsystem.

Native Remote WSL Workflow
#

With Remote - WSL, VS Code delegates development tasks directly into Linux:

VS Code (Windows UI)
└── Remote Session Connected to WSL
    ├── Editing ~/project/*
    ├── Native ext4 filesystem access
    ├── Linux-based Git operations
    ├── WSL Bash terminal
    └── Extensions running inside Linux

The result is a development environment that behaves like a native Linux workstation while preserving the Windows desktop experience.

Key Benefits
#

  • Native Linux filesystem performance
  • Faster Git operations
  • Improved extension compatibility
  • Consistent terminal tooling
  • Better Docker and container integration
  • Lower latency for large repositories
  • Reliable language server performance

⚙️ Installing and Connecting VS Code to WSL
#

Install Required Packages Inside WSL
#

Before configuring VS Code, ensure the WSL environment includes essential developer utilities:

sudo apt update
sudo apt install -y git curl wget ca-certificates

Install VS Code on Windows
#

Install VS Code using one of the following methods:

Method 1:
Microsoft Store → Search "Visual Studio Code"

Method 2:
winget install Microsoft.VisualStudioCode

Method 3:
Official Website:
https://code.visualstudio.com/

Install the Remote - WSL Extension
#

  1. Open VS Code
  2. Press Ctrl + Shift + X
  3. Search for Remote - WSL
  4. Install the Microsoft extension: ms-vscode-remote.remote-wsl

Recommended companion extensions:

  • Remote - SSH
  • Remote - Containers

These extensions complement remote development workflows across servers and containers.


🔌 Connecting VS Code to WSL
#

Method 1: Command Palette
#

The most common workflow:

  1. Press Ctrl + Shift + P
  2. Search for WSL
  3. Select Remote-WSL: Connect to WSL
  4. Choose your Linux distribution

Once connected, VS Code opens a new remote session window.

Method 2: Bottom-Left Remote Indicator
#

  1. Click the green remote icon in the lower-left corner
  2. Select Connect to WSL
  3. Choose the target distribution

Method 3: Launch Directly from WSL
#

Inside the WSL terminal:

code .
code ~/project
code ~/workspace/app

This automatically launches VS Code in Remote-WSL mode.

Verify the Remote Session
#

A properly connected environment shows:

  • WSL: Ubuntu-24.04 in the status bar
  • Linux Bash in the integrated terminal
  • Linux filesystem paths by default
  • Remote extension activation inside WSL

🧩 Recommended VS Code Extensions #

Core Extensions
#

Extension ID Purpose
Remote - WSL ms-vscode-remote.remote-wsl Core WSL remote backend
Pylance ms-python.vscode-pylance Python IntelliSense
ESLint dbaeumer.vscode-eslint JavaScript/TypeScript linting
GitLens eamodio.gitlens Advanced Git tooling
Material Icon Theme PKief.material-icon-theme Improved file icons

Python Development
#

Extension Purpose
Python (ms-python.python) Debugging and interpreter integration
Black Formatter Automatic formatting
isort Import organization
Jupyter Notebook support

JavaScript and TypeScript
#

Extension Purpose
Tailwind CSS IntelliSense Tailwind autocomplete
Error Lens Inline diagnostics
JavaScript Booster Refactoring utilities

Productivity Enhancements
#

Extension Purpose
One Dark Pro Popular dark theme
Auto Rename Tag Paired HTML/XML tag renaming
Path Intellisense File path completion
Bracket Pair Colorizer 2 Visual bracket matching

🛠️ Batch Install Recommended Extensions #

Create a recommendations file inside your workspace:

cat > recommended-extensions.json << 'EOF'
{
  "recommendations": [
    "ms-python.vscode-pylance",
    "ms-python.python",
    "ms-python.black-formatter",
    "dbaeumer.vscode-eslint",
    "eamodio.gitlens",
    "PKief.material-icon-theme",
    "bradlc.vscode-tailwindcss",
    "usernamehw.errorlens",
    "CoenraadS.bracket-pair-colorizer-2",
    "formulahendry.auto-rename-tag",
    "christian-kohler.path-intellisense"
  ]
}
EOF

Install extensions manually:

code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension dbaeumer.vscode-eslint

Or automate the process using a shell loop.


⚡ Optimized VS Code settings.json
#

Open User Settings
#

Press:

Ctrl + Shift + P
→ Open User Settings (JSON)

Recommended Configuration #

{
    "editor.fontSize": 14,
    "editor.fontFamily": "'JetBrains Mono', 'Cascadia Mono', 'Fira Code', Consolas, monospace",
    "editor.fontLigatures": true,
    "editor.renderWhitespace": "boundary",
    "editor.minimap.enabled": false,
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "editor.guides.bracketPairs": "active",
    "editor.linkedEditing": true,

    "files.eol": "\n",
    "files.insertFinalNewline": true,
    "files.trimTrailingWhitespace": true,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000,

    "terminal.integrated.defaultProfile.linux": "bash",
    "terminal.integrated.fontSize": 13,
    "terminal.integrated.scrollback": 5000,

    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": "explicit"
        }
    },

    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },

    "[typescript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },

    "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",

    "git.enableSmartCommit": true,
    "git.autofetch": true,
    "git.confirmSync": false,

    "remote.WSL.fileWatcher.polling": true,
    "remote.autoForwardPorts": true,
    "remote.restoreForwardedPorts": true,

    "workbench.colorTheme": "One Dark Pro",
    "workbench.iconTheme": "material-icon-theme"
}

Important Configuration Details
#

Setting Why It Matters
"files.eol": "\n" Prevents CRLF/LF conflicts across environments
"editor.formatOnSave": true Maintains consistent formatting
"remote.WSL.fileWatcher.polling": true Improves filesystem synchronization reliability
"remote.autoForwardPorts": true Automatically forwards local development services

🧠 High-Efficiency Development Workflows
#

Daily Development Workflow
#

Open projects directly from WSL:

code ~/projects/my-app

Typical workflow:

  1. Launch project in Remote-WSL mode
  2. Use native Linux tooling
  3. Run tests inside WSL terminal
  4. Commit changes through integrated Git tooling
  5. Debug applications with automatic browser integration

Example commands:

python3 main.py
npm test
go run .

Parallel Multi-Window Workflow
#

A highly productive setup typically includes:

Window Purpose
VS Code Window A Main application development
Browser Window Preview and DevTools
VS Code Window B Documentation or secondary repository

All sessions share the same underlying WSL environment.

Automatic Port Forwarding
#

Start a service inside WSL:

python3 -m http.server 8000

VS Code automatically detects and forwards the port to Windows.

This provides seamless localhost integration between Linux services and Windows browsers.


⌨️ Essential Keyboard Shortcuts
#

Shortcut Action
Ctrl + Shift + P Command Palette
`Ctrl + `` Toggle terminal
Ctrl + Shift + B Run build task
F5 Start debugger
Ctrl + Shift + E Explorer
Ctrl + Shift + G Source Control
Ctrl + Shift + X Extensions
Ctrl + P Quick file search
Ctrl + Shift + F Global search
Ctrl + , Open settings
Shift + Alt + F Format document

🧯 Troubleshooting Common Remote-WSL Issues
#

VS Code Server Installation Failed
#

Remove the existing server state:

rm -rf ~/.vscode-server

Reconnect to WSL and allow VS Code to reinstall the server automatically.

Slow Extension Downloads
#

Disable automatic extension updates:

{
  "extensions.autoUpdate": false
}

Using a proxy or mirror can also improve marketplace performance in restricted regions.

Chinese IME Input Issues
#

WSLg input handling can occasionally behave inconsistently.

Potential workarounds:

  • Copy/paste from Windows-native applications
  • Configure fcitx5 inside Linux
  • Open projects locally when full IME support is required

Verify Remote Mode
#

You are correctly connected when:

  • The status bar shows WSL: Ubuntu
  • The terminal prompt uses Linux shell syntax
  • Extensions display the (WSL) indicator
  • Files resolve under Linux paths like /home/user

📌 Final Thoughts
#

VS Code Remote - WSL is arguably the best development environment available for Windows-based engineers who depend on Linux tooling.

It eliminates most filesystem bottlenecks, provides native Linux execution, and preserves the convenience of the Windows desktop ecosystem. Combined with optimized extensions and a tuned settings.json, the workflow becomes fast, stable, and highly scalable for modern development stacks.

For Python, Node.js, Go, Rust, Docker, Kubernetes, and cloud-native workflows, Remote-WSL offers a near-native Linux experience without abandoning Windows entirely.

Related

Run Multiple Linux Commands in One Line: A Practical Guide
·599 words·3 mins
Linux Bash Terminal Command Line System Administration
QNX vs Linux Signal Handling: Destructors, exit and Safe Shutdown
·480 words·3 mins
QNX Linux Signal-Handling C++ RTOS Embedded Systems Posix Destructors Shutdown Debugging
find -exec vs xargs: Linux Performance Comparison
·551 words·3 mins
Linux Linux Commands System Administration Performance Optimization Shell Utilities