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

convert wsl to wsl2

wsl --set-version <distro_name> <version>
wsl --set-version Ubuntu-18.04 2
wsl --set-version Ubuntu-20.04 2
Comment

install wsl2 windows 10 pro

wsl --install
Comment

how to WSL2

Enable Windows Subsystem for linux: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Enable Virtual Machine Platform: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Download WSL2 kernel: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Set default WSL verison: wsl --set-default-version 2
Comment

convert wsl to wsl2

wsl --set-version <distro_name> <version>
wsl --set-version Ubuntu-18.04 2
wsl --set-version Ubuntu-20.04 2
Comment

convert wsl to wsl2

wsl --set-version <distro_name> <version>
wsl --set-version Ubuntu-18.04 2
wsl --set-version Ubuntu-20.04 2
Comment

wsl2 settings

[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 :: yum repository 
Shell :: gatsby image 
Shell :: how to calculate nearest location using longitude and latitude 
Shell :: gnome terminator 
Shell :: how to install tor on kali linux 
Shell :: como instalar pandoc en ubuntu 
Shell :: new ip linux 
Shell :: firebase cli 
Shell :: odoo run command line 
Shell :: copy file to other location linux terminal 
Shell :: install homebre windows 
Shell :: git initial commit 
Shell :: docker desktop ubuntu install 
Shell :: terminal mkv to mp4 
Shell :: find command path 
Shell :: vs code linux cache 
Shell :: git request-pull 
Shell :: git unstage a file 
Shell :: merge branch into master 
Shell :: ssh codecommit 
Shell :: how to make apache not run automatically linux 
Shell :: how delete branch from specific origin 
Shell :: git clone 
Shell :: download atom for ubuntu 18.04 
Shell :: minikube insecure registry 
Shell :: creating a branch from a commit 
Shell :: bash argument parsing 
Shell :: View Commit History With Changes 
Shell :: how to delete remote file locally on git 
Shell :: Download file from URL on Linux using command line 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =