Setup instructions WSL2 for web development
For this setup to work, you need to...
- ...have either Windows 11 or Windows 10 version 2004 and higher (Build 19041 and higher) installed
- ...have CPU virtualization feature turned on in BIOS
- ...have Hyper V Windows Service activated
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
...in Powershell does the job.
- Running ddev webserver managed with Docker Desktop for all services your webproject requires
- Running PHPStorm on Windows host machine, including container management (via hook to Docker Desktop), fast file system indexation, WSL2 terminal support and much more
- Virtual Machine Performance issues
- Dual desktops and switching between host machine and virtual machine disturbs workflows
- Full webserver scope management can be extremely tedious
- Breaking one service can destroy your whole webserver setup
NOTE: This instruction manual is still work in progress, as is WSL2. I take no responsibility for any damage done to your system.
Microsoft's instructions
Microsoft's instructions (GER)
- In Windows Powershell, run:
wsl --install
wsl --set-default-version 2
- In Windows User directory, create or update
.wslconfig
:
[wsl2]
memory=10GB
processors=8
swap=10GB
localhostForwarding=true
Change these values according to your needs / specs
- To install Ubuntu 20 LTS or any other of the supported distributions open Windows Store search for it, and run the installation
- Launch your distribution!
Show Docker Desktop (WSL2) Setup instructions
- Natively supports Magento 2 projects!
- Due to the architecture of WSL2, you don't want your projects being located in the Windows file system (as WSL2 is significantly slower here, due to file system difference)
- Instead, you create and manage your projects inside the subsystem and use any IDE on the host Windows system to edit them