Skip to content

Instantly share code, notes, and snippets.

@hoangitk
Created December 9, 2022 04:00
Show Gist options
  • Save hoangitk/dac64d31bf1633738aae4bbd5fc70218 to your computer and use it in GitHub Desktop.
Save hoangitk/dac64d31bf1633738aae4bbd5fc70218 to your computer and use it in GitHub Desktop.
[Install WSL Distro into other location] #wsl

Install WSL Distro into other location

  • Download Distro
     Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing
    • Available Distros:
    Ubuntu 20.04 - https://aka.ms/wslubuntu2004
    
    Ubuntu 20.04 ARM - https://aka.ms/wslubuntu2004arm
    
    Ubuntu 18.04 - https://aka.ms/wsl-ubuntu-1804
    
    Ubuntu 18.04 ARM - https://aka.ms/wsl-ubuntu-1804-arm
    
    Ubuntu 16.04 - https://aka.ms/wsl-ubuntu-1604
    
    Debian GNU/Linux - https://aka.ms/wsl-debian-gnulinux
    
    Kali Linux - https://aka.ms/wsl-kali-linux-new
    
    OpenSUSE Leap 42 - https://aka.ms/wsl-opensuse-42
    
    SLES - https://aka.ms/wsl-sles-12
    
  • Unpack the distro
     move .\Ubuntu.appx .\Ubuntu.zip
     Expand-Archive .\Ubuntu.zip
  • Import
     wsl.exe --import <DistributionName> <InstallLocation> <FileName>    
    eg: wsl.exe --import Debian1 D:\Deb1 .\install.tar.gz

Credit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment