怎么提升网站收录,手机套 东莞网站建设,馨雨公司网站建设策划方案,网站架构图用什么做参考WSL 中的高级设置配置 | Microsoft Learn
查看LinuxCPU核数
cat /proc/cpuinfo | grep processor | wc -l
先关闭所有wsl终端#xff0c;远程连接开发的IDE也需要关闭#xff0c;因为工具链开着给你wsl没有完全关闭#xff0c;在Windows的power shell终端…参考WSL 中的高级设置配置 | Microsoft Learn
查看LinuxCPU核数
cat /proc/cpuinfo | grep processor | wc -l
先关闭所有wsl终端远程连接开发的IDE也需要关闭因为工具链开着给你wsl没有完全关闭在Windows的power shell终端命令行窗口可以实验以下命令检查是否wsl已经关闭
wsl --list --running
如果响应没有正在运行的分发版就说明所有Linux子系统已经关闭
创建文件C:\Users\UserName\.wslconfig目录必须对例如C:\Users\Yezi
然后文件内容复制下面信息CPU核数为processors修改即可在确认所有Linux子系统已经关闭的情况下保存文件重启wsl即可
# 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 MB
memory4GB # Sets the VM to use two virtual processors
processors1# Specify a custom Linux kernel to use with your installed distros. The default kernel used can be found at https://github.com/microsoft/WSL2-Linux-Kernel
# kernelC:\\temp\\myCustomKernel# Sets additional kernel parameters, in this case enabling older Linux base images such as Centos 6
kernelCommandLine vsyscallemulate# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap8GB# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
# swapfileC:\\temp\\wsl-swap.vhdx# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
pageReportingfalse# Turn on default connection to bind WSL 2 localhost to Windows localhost. Setting is ignored when networkingModemirrored
localhostforwardingtrue# Disables nested virtualization
nestedVirtualizationfalse# Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging
debugConsoletrue# Enable experimental features
[experimental]
sparseVhdtrue