Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.76 KB

windows_wsl2.md

File metadata and controls

37 lines (24 loc) · 1.76 KB

Docker a Windows Subsystem for Linux (WSL-2)

Windows users will need to install Windows subsystem for Linux (WSL). You can also find guidance from Docker on the WSL-2 backend.

Memory settings

Based on this guide, you can do the following to manage the memory available to WSL-2.

  1. Open Windows Terminal/CMD/PowerShell.

  2. Run the following command (if the notepad command doesn't work you can manually create the file.

    # turn off all wsl instances such as docker-desktop
    wsl --shutdown
    notepad "$env:USERPROFILE/.wslconfig"
  3. Edit .wslconfig file with notepad and write down these settings:

    [wsl2]
    memory=5GB   # Limits VM memory in WSL 2 up to 5GB
    processors=4 # Makes the WSL 2 VM use two virtual processors
    
  4. Save the .wslconfig file and restart Docker.

You can see the other WSL 2 Settings available for manipulation using the .wslconfig.

Other references