Windows 10
Last updated
Last updated
將 port 80 導向 59600
適用于 Windows 組建 19041 和更新版本
將 .wslconfig
放到 [使用者] 資料夾的根目錄中,以設定全域 WSL ex:C:\Users<yourUserName>.wslconfig
須重開才會套用 wsl --shutdown
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 localhost:port.
kernelCommandLine
string
Blank
Additional kernel command line arguments.
swap
size
25% of memory size on Windows rounded up to the nearest GB
How much swap space to add to the WSL 2 VM, 0 for no swap file.
swapFile
string
%USERPROFILE%\AppData\Local\Temp\swap.vhdx
An absolute Windows path to the swap virtual hard disk.
Entries with the path value must be Windows paths with escaped backslashes, e.g: C:\Temp\myCustomKernel
Entries with the size value must be a size followed by a unit, for example 8GB or 512MB.
預設位置:%LOCALAPPDATA%/Docker/wsl
默認情況下,Docker Desktop for Window 會創建如下兩個發行版(distro):
data/ext4.vhdx 是被 docker-desktop-data 使用 distro/ext4.vhdx 是被 docker-desktop 使用
錯誤 809:無法建立計算機與 VPN 服務器之間的網路連接,因為遠程服務器無回應。這可能是因為未將計算機與遠程服務器之間的某種網路設備 (如防火牆、NAT、路由器等) 配置為允許 VPN 連接。請與管理員或服務提供商聯系以確定哪種設備可能產生此問題。
註: 僅當你使用 IPsec/L2TP 模式連接到 VPN 時,才需要進行的註冊表更改。對於 IKEv2
和 IPsec/XAuth
模式,無需進行此更改。
另外,某些個別的 Windows 系統禁用了 IPsec 加密,也會導致連接失敗。要重新啟用它,可以運行以下命令並重啟。
ForFiles /p "C:\path\to\folder" /s /d -30 /c "cmd /c del /q @file"
(gci "C:\path\to\folder" -r | ? {$.PSIsContainer -eq $True}) | ?{$.GetFileSystemInfos().Count -eq 0} | remove-item
netstat -ano | findstr 0.0:80
netsh interface ipv4 show excludedportrange protocol=tcp
net stop winnat net start winnat
要解決此錯誤,在首次連接之前需要,以解決 VPN 服務器 和/或 客戶端與 NAT(比如路由器)的相容問題。請下載並導入下麵的 .reg
文件,或者打開 並運行以下命令。完成後必須重啟。
適用於 Windows Vista, 7, 8.x 和 10 ()
僅適用於 Windows XP ()
適用於 Windows XP, Vista, 7, 8.x 和 10 ()