Skip to content

Instantly share code, notes, and snippets.

@felipecustodio
Created October 3, 2023 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipecustodio/6454386d7d59142d4966981ec91cac8e to your computer and use it in GitHub Desktop.
Save felipecustodio/6454386d7d59142d4966981ec91cac8e to your computer and use it in GitHub Desktop.
Fix slow upload speeds when using WSL2 in Windows, due to LSO issues
# PowerShell script for WSL (Windows Subsystem for Linux) Configuration
Write-Host "==============================================="
Write-Host "Windows Subsystem for Linux (WSL) Configuration"
Write-Host "==============================================="
Write-Host ""
# Explanation of script actions
Write-Host "This script performs the following actions:"
Write-Host "1. Shuts down the WSL (Windows Subsystem for Linux)."
Write-Host "2. Disables IPv6 for the WSL virtual Ethernet adapter."
Write-Host "3. Disables Large Send Offload (LSO) for the WSL virtual Ethernet adapter."
Write-Host ""
# Step 1: Shutting down WSL
Write-Host "-----------------------------------------------"
Write-Host "Step 1: Shutting down WSL"
Write-Host "-----------------------------------------------"
wsl --shutdown
# Step 2: Disabling IPv6 for WSL adapter
Write-Host "-----------------------------------------------"
Write-Host "Step 2: Disabling IPv6 for WSL adapter"
Write-Host "-----------------------------------------------"
Disable-NetAdapterBinding -Name "vEthernet (WSL)" -ComponentID ms_tcpip6 -IncludeHidden
# Step 3: Disabling LSO for WSL adapter
Write-Host "-----------------------------------------------"
Write-Host "Step 3: Disabling LSO for WSL adapter"
Write-Host "-----------------------------------------------"
Disable-NetAdapterLso -Name "vEthernet (WSL)" -IncludeHidden
Write-Host ""
Write-Host "==============================================="
Write-Host "WSL Configuration Complete"
Write-Host "==============================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment