
https://docs.microsoft.com/en-us/windows/wsl/wsl-config .wslconfig - Stored in your
%UserProfile% directory. - Used to configure settings globally across all installed Linux distributions running as the WSL 2 version.Can be usedonly 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, usecd ~ 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 .WSL will detect the existence of these files, read the contents, and automatically apply the configuration settings every time you launch WSL. If the file is missing or malformed (improper markup formatting), WSL will continue to launch as normal without the configuration settings applied. Check which version of WSL you are running. Note Adjusting per-distribution settings with the wsl.conf file is only available in Windows Build 17093 and later. 
Configuration setting for .wslconfigThe .wslconfig file configures settings globally for all Linux distributions running with WSL 2.(For per-distribution configuration seewsl.conf). See.wslconfigfor info on where to store the .wslconfig file. Note Global configuration options with.wslconfig is only available for distributions running as WSL 2 in Windows Build 19041 and later. Keep in mind you may need to runwsl --shutdown to shut down the WSL 2 VM and then restart your WSL instance for these changes to take affect. This file can contain the following options that affect the VM that powers any WSL 2 distribution: Section label:[wsl2] key | value | default | notes | kernel | string | The Microsoft built kernel provided inbox | An absolute Windows path to a custom Linux kernel. | memory | size | 50% of total memory on Windows or 8GB, whichever is less; on builds before 20175: 80% of your total memory on Windows | How much memory to assign to the WSL 2 VM. | processors | number | The same number of processors on Windows | How many processors to assign to the WSL 2 VM. | localhostForwarding | boolean | true | Boolean specifying if ports bound to wildcard or localhost in the WSL 2 VM should be connectable from the host via 下载地址: Docker匿名挂载和具名挂载的具体使用 centos7修改网卡后无法上网问题解决过程 |
|