🐧 Linux + Windows = Perfect Dev Environment
Need Linux tools but stuck on Windows? No dual boot needed. WSL2 runs full Linux kernel inside Windows. Native performance.
Install WSL2 (One Command)
# Open PowerShell as Administrator wsl --install # That's it! Installs: # - WSL2 # - Ubuntu (default) # - Virtual Machine Platform # Restart computer # Ubuntu terminal opens automatically # Set username and password
🎯 What You Get
- Full Linux terminal: bash, zsh, all Unix commands
- Package managers: apt, snap, brew
- Development tools: git, docker, node, python, etc.
- File system integration: Access Windows files from Linux
- VS Code integration: Edit Linux files in VS Code
- Docker Desktop integration: Run containers in WSL2
Essential WSL2 Commands
# List installed distributions wsl --list --verbose # Set default distribution wsl --set-default Ubuntu # Update WSL2 wsl --update # Shutdown all distributions wsl --shutdown # Access from Windows File Explorer \\wsl$\Ubuntu\home\username # Access Windows files from Linux cd /mnt/c/Users/YourName/Documents
VS Code + WSL2 Integration
🔧 Setup
- Install “Remote – WSL” extension in VS Code
- Open WSL terminal
- Navigate to project:
cd ~/myproject - Type:
code . - VS Code opens, running in WSL2!
Result: VS Code on Windows, code runs in Linux. Terminal, extensions, everything uses Linux.
Real Development Workflow
# Install Node.js in WSL2 curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs # Clone repo git clone https://github.com/yourname/project.git cd project # Install dependencies (Linux versions) npm install # Run dev server npm run dev # Access from Windows browser: http://localhost:3000 # Networking just works!
💡 Use Cases
- Web development: Node, PHP, Ruby apps with Linux tools
- Docker: Better performance than Docker Desktop alone
- DevOps: Test bash scripts, Ansible, Terraform locally
- Data science: Python, Jupyter, Linux data tools
- Learning Linux: Practice without dual boot
⚡ Performance Tips
- Store files in Linux filesystem: Projects in
~/projectsnot/mnt/c/ - Reason: 10x faster file I/O when files are native to WSL2
- Limit memory: Create
.wslconfigin Windows user folder - Backup: Export:
wsl --export Ubuntu backup.tar
🎨 Multiple Distributions
# Install different distros wsl --install -d Debian wsl --install -d kali-linux # Run specific distro wsl -d Debian # Use different distros for different projects # Ubuntu for web dev, Kali for security testing
“Switched from dual boot to WSL2. Same Linux development experience, zero reboot hassle. Docker runs faster. VS Code integration is seamless. Never going back to dual boot.”
🎯 Best of Both Worlds
🪟
Windows
Office, Photoshop, Games
🐧
Linux
Development, DevOps, CLI
