xxxxxxxxxx
1) Run PowerShell as administrator
2) Paste this command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
3) Restart your PC
4) Run PowerShell as administrator again
5) Paste these two commands:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
6) Restart your PC Again
7) Download the Linux Kernel Update Package from
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
8) Then, run powershell as administrator again and paste this command:
wsl --set-default-version 2
9) Install a distro of your choice from the Microsoft Store (Example Ubuntu, Kali Linux)
OR:
Run this command: wsl --install
NOTE: To Run this command given above, you must be running
Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.
Also, running this command installs Ubuntu by default.
xxxxxxxxxx
# Step 1: Open PowerShell as Administrator
# Press Windows key, type "PowerShell", right-click on "Windows PowerShell" and select "Run as administrator"
# Step 2: Enable WSL feature
# Execute the following command in the PowerShell window and restart your computer when prompted
wsl --install
# Step 3: Install a Linux distribution
# After your computer is restarted, open the Microsoft Store and search for your preferred Linux distribution (e.g., Ubuntu, Debian, Fedora). Select one and click on the "Install" button.
# Step 4: Launch and set up the Linux distribution
# Open the installed Linux distribution from the Start menu. The first launch will take a few moments to set up the environment. You will then be prompted to create a new user and set a password for your Linux environment.
# That's it! You have successfully installed WSL on Windows 11 and a Linux distribution of your choice.
xxxxxxxxxx
# Install Ubuntu WSL without Windows Store
https://stackoverflow.com/a/64872285
xxxxxxxxxx
Adding a windows installed application to WSL path so we can run from Ubuntu wsl:
Install app on Windows.
Find the applications path to the folder where the executable file (app.exe) is located
copy the path.
on WSL, go to the root folder where .bashrc is located
nano .bashrc
scroll to the end of file and add the path & alias using the format below
export PATH="$PATH:/mnt/c/Program Files/Amazon/AWSCLIV2"
alias aws='aws.exe'
save
apply changes by run source command below
source ~/.bashrc
Now, you should be able to run the application from anywhere in the WSL terminal
xxxxxxxxxx
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart