Skip to content

Instantly share code, notes, and snippets.

@zachcb
Last active February 15, 2022 20:57
Show Gist options
  • Save zachcb/45e8e7a2bf1fd873c9ef61adf6a3e554 to your computer and use it in GitHub Desktop.
Save zachcb/45e8e7a2bf1fd873c9ef61adf6a3e554 to your computer and use it in GitHub Desktop.
Windows WSL

Steps

  • Follow this Setup
  • Make sure Node is in Windows Path
  • Add .wslconfig
  • Activate Docker WSL to Ubuntu in Docker App Settings
  • Git clone from inside WSL, not Windows
  • Symlink to directory
  • Use yarn start-lite
    • Yarn uses a lot of resources in Windows

%UserProfile%\.wslconfig

[wsl2]
memory=8GB
swap=4GB # or swap=0 if there are issues with memory offloading  
localhostForwarding=true

Tips

Docker May Need Sudo In Windows sudo docker-compose up --build

Start WSL wsl

Shutdown WSL wsl.exe --shutdown

Build and Run Docker docker-compose up --build

Stop Docker Containers docker-compose down

Prune Docker Resources docker system prune -a --volumes

https://jimmybogard.com/taming-the-wsl-2-resource-monster/

https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig

microsoft/WSL#4166 (comment)

https://medium.com/twodigits/wsl-performance-using-intel-and-microsoft-drivers-f8aef9bf15dc

https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment