Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
Windows

Windows 11: Use WSL2 to Run Linux Tools Natively on Windows

- 22.03.26 - ErcanOPAK

🐧 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

  1. Install “Remote – WSL” extension in VS Code
  2. Open WSL terminal
  3. Navigate to project: cd ~/myproject
  4. Type: code .
  5. 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 ~/projects not /mnt/c/
  • Reason: 10x faster file I/O when files are native to WSL2
  • Limit memory: Create .wslconfig in 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.”

— Full-Stack Developer

🎯 Best of Both Worlds

🪟
Windows
Office, Photoshop, Games

🐧
Linux
Development, DevOps, CLI

Related posts:

Windows 11: Professional Log Auditing with KQL and Event Viewer

Windows 11 Feels Slower After Updates

Why Windows 11 Randomly Feels Sluggish After Updates

Post Views: 5

Post navigation

AI Prompt: Learn New Technology with Personalized Curriculum
Windows 11: Customize Windows Terminal for Professional Development

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (751)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (531)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (489)
  • Find numbers with more than two decimal places in SQL (447)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (751)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com