.wslconfig 节标签:[experimental] 设置名称值默认值说明 autoMemoryReclaimstringdisabled检测空闲 CPU 使用率后,自动释放缓存的内存。 设置为gradual以慢速释放,设置为dropcache以立即释放缓存的内存。 sparseVhd布尔false如果设置为 true,则任何新创建的 VHD 将自动设置为稀疏。
新建文件C:\Users\<UserName>\.wslconfig,修改memory和processors条目: # Settings apply across all Linux distros running on WSL 2[wsl2]# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MBmemory=8GB# Sets the VM to use two virtual processorsprocesso...
该文件在Windows的存储目录一般为C:\Users\ {UserName}\.wslconfig。 该配置更改后必须wsl重启后才能生效(8秒规则)。 操作步骤 一、 关闭WSL虚拟机。 wsl --shutdown 二、在C:\Users\ {UserName}\.wslconfig中修改相关配置,(如果没有相关文件需要新建一个配置文件。) 示例: [wsl2]memory=16GBswap=8GB 三、...
.wslconfig 节标签:[experimental] 设置名称值默认值说明 autoMemoryReclaimstringdisabled检测空闲 CPU 使用率后,自动释放缓存的内存。 设置为gradual以慢速释放,设置为dropcache以立即释放缓存的内存。 sparseVhd布尔false如果设置为 true,则任何新创建的 VHD 将自动设置为稀疏。
.wslconfig 节标签:[experimental] 设置名称值默认值说明 autoMemoryReclaimstringdisabled检测空闲 CPU 使用率后,自动释放缓存的内存。 设置为gradual以慢速释放,设置为dropcache以立即释放缓存的内存。 sparseVhd布尔false如果设置为 true,则任何新创建的 VHD 将自动设置为稀疏。
.wslconfig 區段卷標:[experimental] 設定名稱值預設備註 autoMemoryReclaim字串disabled偵測閒置 CPU 使用量之後,自動釋放快取的記憶體。 設定為gradual以緩慢釋放,而設定為dropcache會立即釋放快取的記憶體。 sparseVhdboolfalse當設定為 true 時,任何新建立的 VHD 都會自動設定為疏鬆。
打开.wslconfig 文件目录:Win+R 运行 %UserProfile% ,会打开用户目录,然后新建一个 wslconfig 文件。 .wslconfig 配置可以参考如下内容: [experimental] #自动释放内存autoMemoryReclaim=gradual #网络镜像模式 networkingMode=mirrored hostAdd ressLoopback=true #共用 Windows DNS、防火墙、代理设置 dnsTunneling=true...
示例.wslconfig 文件 .wslconfig下面的示例文件演示了一些可用的配置选项。在此示例中,文件路径为 C:\Users<UserName>\.wslconfig. Bash复制 代码语言:javascript 代码运行次数:0 运行 AI代码解释 # Settings apply across all Linux distros running on WSL 2 [wsl2] # Limits VM memory to use no mo...
在Windows 用户目录下创建或编辑 .wslconfig 文件,路径通常是 C:\Users\<your_username>\。 在.wslconfig 文件中输入以下内容:ini[experimental] autoMemoryReclaim=gradual networkingMode=mirrored dnsTunneling=true firewall=true autoProxy=true这些设置会开启自动回收内存、设置镜像网络模式、开启 DNS Tunneling、开启...
.wslconfig使用 VSCode(或任何您喜欢的编辑器)再次打开文件 AI检测代码解析 # PowerShellcode .wslconfig 1. 2. 并设置实验标志(根据您的需要)。例如: AI检测代码解析 [experimental]# Automatic memory reclaimautoMemoryReclaim=gradual# Automatic disk space clean upsparseVhd=true ...