#Powershell in Administrator mode
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart
# install choco
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Restart-Computer -Confirm
After restart
#Powershell in Administrator mode
wsl.exe --set-default-version 2
choco install wsl-ubuntu-2004 -yf
if
--set-default-version 2
failed you may need to install the update manually from https://aka.ms/wsl2kernel
Install docker with choco
#Powershell in Administrator mode
choco.exe install docker-desktop
Restart-Computer -Confirm
If everything worked you might want to update the apt packages log in to ubuntu by running wsl.exe in cmd or powershell then run
sudo apt-get update
sudo apt-get install
In WSL Ubuntu
curl -s https://laravel.build/sailapp | bash
cd sailapp
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
sail up -d
sail composer require swooletw/laravel-swoole
add 8000 port mapping in docker-compose.yml and then restart sail and run
sail artisan swoole:http start