Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

wslconfig

## Create .wslconfig in C:/Users/youruser

[wsl2]
memory=3GB   # Limits VM memory in WSL 2 up to 3GB
processors=4 # Makes the WSL 2 VM use four virtual processors
Comment

wslconfig example

[wsl2]
# https://docs.microsoft.com/en-us/windows/wsl/wsl-config (Docs)
# https://github.com/microsoft/WSL/issues/4166 (Topic)
memory=4GB
swap=16GB
localhostForwarding=true
Comment

WSL2 .wslconfig Windows

# turn off all wsl instances such as docker-desktop
wsl --shutdown
notepad "$env:USERPROFILE/.wslconfig"

# .wslconfig
[wsl2]
memory=3GB   # Limits VM memory in WSL 2 up to 3GB
processors=4 # Makes the WSL 2 VM use two virtual processors
Comment

wslconfig

Stored in your %UserProfile% directory.
Used to configure settings globally across all installed Linux distributions running as the WSL 2 version.
Can be used only for distributions run by WSL 2. Distributions running as WSL 1 will not be affected by this configuration as they are not running as a virtual machine.
To get to your %UserProfile% directory, in PowerShell, use cd ~ to access your home directory (which is typically your user profile, C:Users<UserName>) or you can open Windows File Explorer and enter %UserProfile% in the address bar. The directory path should look something like: C:Users<UserName>.wslconfig.
Comment

PREVIOUS NEXT
Code Example
Shell :: remove dbeaver ubuntu 7.1.5 
Shell :: git checkout new branch 
Shell :: error running pod install 
Shell :: ubuntu delete directory and all files 
Shell :: git pull remote branch 
Shell :: git go back to previous commit remote branch 
Shell :: install jest 
Shell :: bash scripting string comparison 
Shell :: elevated privileges windows 10 
Shell :: verify xcode command tools installation 
Shell :: how to run explorer in wsl 
Shell :: grep windows 
Shell :: git how to reset only one file 
Shell :: Error: EACCES: permission denied, mkdtemp linux ubuntu 
Shell :: linux linebreaks script bash 
Shell :: git reset branch 
Shell :: default parameter value in bash 
Shell :: screen recorder for ubuntu 
Shell :: pip command to install yaml 5.1.2 
Shell :: gzip folder .gz file in linux 
Shell :: find image size terminal 
Shell :: run cmd as administrator command line 
Shell :: double quotes inside double quotes bash 
Shell :: nvm install stable not found 
Shell :: docker run name 
Shell :: xargs multiple commands "mac" 
Shell :: yarn add install all packages in package,json 
Shell :: npm install production 
Shell :: docker compose install debian 
Shell :: export import all vscode extensions 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =