WSL SPECIFIC

wsl2 :Zone-identifier Removal

find . -name "*:Zone.Identifier" -type f -delete

wsl2 Add new user

adduser username
# Open wsl.conf with this
nano /etc/wsl.conf
# ADD THIS
[user]
default=username

Restart Wsl2 When Shutdown Doesn’t Work

# In Powershell with Admin Priviliges
tasklist /svc /fi "imagename eq svchost.exe" | findstr LxssManager
# Grab the returned PID and Open Task Manager with Admin Priviliges
# Search for the svchost.exe containing the PID,
# Right click it and select 'end process tree'
# In powershell
wsl --shutdown
# or 
sudo restart-service Lxssmanager
wsl

wsl2 E: Failed to fetch Hatası Çözümü

"wsl2 E: Failed to fetch hatası" veya "connection timed out; no servers could be reached" sorunlarının çözümünü göstereceğim.

  1. sudo touch /etc/wsl.conf komutu ile bu dosyayı oluşturun.
  2. Dosyanın içine aşaıdaki satırları ekleyin. (Eklemek için sudo nano /etc/wsl.conf komutunu kullanabilirsiniz.)
[network]
generateResolvConf = false
  1. Sonra cmd penceresini açıp şu komutu çalıştırıp wsl'i kapatın: wsl --shutdown

  2. WSL2'yi yeniden açın.

  3. sudo touch /etc/resolv.conf komutu ile bu dosyayı oluşturun. .Eğer dosya varsa eskisini sudo rm resolv.conf/ komutuyla silip yenisini sudo touch /etc/resolv.conf komutu ile oluşturun.

  4. Dosyanın içine aşağıdaki DNS adresini bu şekilde yazın.

nameserver 8.8.8.8
  1. Sonra cmd penceresini açıp şu komutu çalıştırıp wsl'i kapatın: wsl --shutdown

  2. WSL2'yi yeniden açın.

  3. sudo apt-get update komutunu çalıştırın.