Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.86 KB

wsl2-setup.md

File metadata and controls

61 lines (44 loc) · 1.86 KB

WSL Instalation!

1 - Enable the Windows Subsystem for Linux

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

2 - Enable Virtual Machine feature

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

3 - Download the Linux kernel update package

Microsoft Official WSL2 Linux kernel update package for x64 machines

4 - Set WSL 2 as your default version

wsl --set-default-version 2

5 - Install Linux distribution

6 - Set Linux distribution version to WSL 1 or WSL 2

wsl --set-version <distribution name> <versionNumber>

Example:

wsl --set-version Debian 2

Version 2 by default (recommended):

wsl --set-default-version 2

7 - Configure WSL2 Settings

Create a new file identified by '.wslconfig' in the user's root folder, include the necessary settings for it to work on your computer.
[wsl2]

memory=2GB # How much memory to assign to the WSL2 VM.

processors=5 # How many processors to assign to the WSL2 VM.

kernel= # An absolute Windows path to a custom Linux kernel.

swap= # How much swap space to add to the WSL2 VM. 0 for no swap file.

swapFile= # An absolute Windows path to the swap vhd.

localhostForwarding= # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).

References