🌐 Detecting your location…
📢 Advertisement — Configure AdSense in Appearance → Customize → AdSense Settings

WSL2 Complete Setup Guide 2026: Linux unter Windows richtig

⏱️2 min read  ·  390 words
WSL2 Complete Setup Guide 2026: Linux on Windows the Right Way

WSL2(Windows-Subsystem für Linux 2) führt einen vollständigen Linux-Kernel in Windows 11 mit nahezu nativer Leistung aus. Im Jahr 2026 ist WSL2 die Standardentwicklungsumgebung für Windows-Entwickler, die Python, Node, Docker und Cloud-Tools verwenden.

Installieren Sie WSL2

Öffnen Sie PowerShell als Administrator und führen Sie einen Befehl aus. Windows installiert WSL2 + Ubuntu automatisch.

# Install WSL2 with Ubuntu (default)
wsl --install

# Choose specific distro
wsl --install -d Ubuntu-24.04

# List available
wsl --list --online

Nach der Installation neu starten. Öffnen Sie Ubuntu über Start, legen Sie Benutzernamen und Passwort fest.

Aktualisieren und installieren Sie Essentials

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential curl git wget unzip

# Python 3.12
sudo apt install -y python3.12 python3.12-venv python3-pip

# Node.js 22 via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22 && nvm use 22

Konfigurieren Sie Git

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global core.autocrlf input
git config --global init.defaultBranch main

# SSH key for GitHub
ssh-keygen -t ed25519 -C "you@example.com"
cat ~/.ssh/id_ed25519.pub  # add to GitHub Settings > SSH Keys

Docker in WSL2

Installieren Sie Docker Desktop unter Windows und aktivieren Sie die WSL2-Integration. Oder installieren Sie Docker Engine direkt in WSL2.

# After Docker Desktop WSL2 integration enabled:
docker --version
docker run hello-world

# Or install Docker Engine directly
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
newgrp docker

Auf Windows-Dateien zugreifen

# C: drive at /mnt/c
ls /mnt/c/Users/YourName/Desktop

# Navigate to Windows project
cd /mnt/c/Users/YourName/Projects/myapp

# Open VS Code from WSL2
code .

# Open Windows Explorer from WSL2
explorer.exe .

Optimieren Sie die WSL2-Leistung

Erstellen Sie%USERPROFILE%\.wslconfigin Windows, um die RAM- und CPU-Auslastung zu begrenzen.

[wsl2]
memory=8GB
processors=4
swap=2GB
localhostForwarding=true

# Apply new config
wsl --shutdown
# Reopen Ubuntu

WSL2 und VS-Code

Installieren SieWSL-Erweiterungim VS-Code. Führen Siecode .aus aus einem beliebigen WSL2-Ordner. VS Code führt seinen Server unter Linux aus – vollständiges IntelliSense und Debugging unter Linux.

Fazit

WSL2 macht Dual-Boot überflüssig. Da Docker, VS Code und Git nativ unter Linux unter Windows ausgeführt werden, erhalten Sie das Beste aus beiden Welten. Richten Sie es einmal ein und Sie werden nie mehr zurückblicken.

✍️ Leave a Comment

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

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা