Installing WSL
Prerequisites for WSL2
- Windows 10 Pro or above.
- Have an x64 or ARM64 machine.
- For x64 systems: Version 1903 or higher, with Build 19041 or higher.
- For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
Enabling WSL2
Enable Virtualization in the BIOS
Before you start setting up WSL on your machine you need to ensure that all BIOS settings pertaining to virtualization are enabled.
- Firstly boot into the BIOS, your machine should should prompt you to press a certain key when it starts to boot.
- Once in the BIOS of your machine you need to look under the CPU settings section (This will differ depending on the brand of the machine you're using) usually it's under one of the following: Processor, Chipset or Northbridge. The setting to enable virtualization may be called: VT-x, AMD-V, SVM or Vanderpool. Enable Intel VT-d or AMD IOMMU if you have the option to.
- After enabling virtualization, you can save and reboot into Windows again.
Enable the WSL feature
Open your Powershell as an Administrator and run the following command:
Enable Virtual Machine feature
Before installing WSL2 you have to enable this feature, otherwise you will get an error. Open your Powershell as an Administrator and run the following command:
Restart your machine
After running both of the above commands, you have to restart your machine in order to complete the WSL 2 install.
Download the Linux kernel update package
Don't forget to install it after downloading!
Set WSL2 as the default verison
Open Powershell as an Administrator and run the following command:
Installing Ubuntu into WSL2
Open Powershell as an Administrator and run the following command:
Once the Ubuntu image has been downloaded and installed you will be prompted to create a user and password. If you want, you can just type in the credentials you're using on your current windows user.
Everything should now be setup. To check this you can open Powershell as an Administrator and run the following command:
You should now see the Ubuntu distribution listed along with the State of the container and WSL version, which should be set to 2.