First of all confirm that you have windows Version 1903 or higher, with Build 18362 or higher. & That virtualization technology is enabled from BIOS/UEFI
- Run the following commands in a powershell window as admin & Reboot your pc
$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Install the wsl package on windows Download
- Run the following command in powershell window as admin
$ wsl --set-default-version 2
- Open the microsoft store and install ubuntu (Recommended distro unless you know what you're doing you can go with something else)
- Once ubuntu is installed launch it up from your start menu, it should prompt you for a username/password pick any, doesn't have to be the same as windows
- Launching WSL from the ubuntu.exe is fine and all but very messy we need something better for day to day activities
- Open microsoft store and download "Windows Terminal"
- Open up windows terminal and go to the settings
- Select the default profile as ubuntu
- Click on the ubuntu profile on the bottom left and change starting directory to
\\wsl$\Ubuntu\home\<the-username-you-picked-for-ubuntu>
- once you launch your wsl instance try doing a
sudo apt update && sudo apt upgrade -y
- if you run into a network problem then do the following steps
- create a file called wsl.conf in /etc/ with
echo '' > /etc/wsl.conf
ortouch /etc/wsl.conf
- add the following data inside of it [network] generateResolvConf = false
- and run the following command
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
- create a file called wsl.conf in /etc/ with