4. 然后运行wsl --manage 发行版名字 --set-sparse true启用稀疏 VHD 允许 WSL2 的硬盘空间自动回收,比如wsl --manage Ubuntu --set-sparse true 然后你会发现,WSL2 和 Windows 主机的网络互通而且 IP 地址相同了,还支持IPv6了,并且从外部(比如局域网)可以同时访问 WSL2 和 Windows 的网络。这波升级彻底带...
步骤3:为指定的 WSL 发行版启用 Sparse VHD 使用PowerShell 或命令提示符运行以下命令,为指定的 WSL 发行版启用 Sparse VHD: wsl --manage <发行版名称> --set-sparse true 1. 例如,如果你使用的是Ubuntu-20.04,那么命令如下: wsl --manage Ubuntu-20.04 --set-sparse true 1. 该命令只需运行一次,之后该...
[wsl2] memory=24GB swap=32GB autoProxy=true dnsTunneling=true networkingMode=mirrored [experimental] autoMemoryReclaim=gradual sparseVhd=true 此外如果遇到一些问题的话,建议升级一下WSL再试,可以使用winget upgrade Microsoft.WSL来更新WSL,下面是我的WSL相关内容的版本信息: 3在WSL中使用自己编译的内核 在WS...
sparseVhd布尔false如果设置为 true,则任何新创建的 VHD 将自动设置为稀疏。 bestEffortDnsParsing**布尔false仅当wsl2.dnsTunneling设置为 true 时才适用。 如果设置为 true,Windows 将从 DNS 请求中提取问题并尝试解决该问题,从而忽略未知记录。 dnsTunnelingIpAddress**字符串10.255.255.254仅当wsl2.dnsTunneling设置...
4. 然后运行wsl --manage 发行版名字 --set-sparse true启用稀疏 VHD 允许 WSL2 的硬盘空间自动回收,比如wsl --manage Ubuntu --set-sparse true然后你会发现,WSL2 和 Windows 主机的网络互通而且 IP 地址相同了,还支持 IPv6 了,并且从外部(比如局域网)可以同时访问 WSL2 和 Windows 的网络。这波升级彻底...
sparseVhd布林false當設定為 true 時,任何新建立的 VHD 都會自動設定為精簡格式。 bestEffortDnsParsing**布林false只有在wsl2.dnsTunneling設定為 true 時才適用。 當設定為 true 時,Windows 會從 DNS 要求擷取問題,並嘗試加以解決,同時忽略未知的記錄。
wsl --manage <distro> --set-sparse true # enable sparse on vdisk wsl --shutdown # restart wsl wsl # restart wsl Then when I check the size, it has not changed at all, still118gbs. SOLUTION (MANUAL SHRINKING): for anyone who finds this in the future. Here is a way to resize the...
hpx502766238commentedSep 18, 2024 I have set sparseVhd=true in .wslconfig then ,copy a clean vhdx from another distribute to E:\data.vhdx then wsl --shutdown wsl --mount --vhd "E:\data.vhdx" lsblk sudo mkfs.ext4 /dev/sdc wsl --shutdown wsl --mount --vhd "E:\data.vhdx" wsl...
wsl --manage Ubuntu --set-sparse true 然后你会发现,WSL2 和 Windows 主机的网络互通而且 IP 地址相同了,还支持 IPv6 了,并且从外部(比如局域网)可以同时访问 WSL2 和 Windows 的网络。 这波升级彻底带回以前 WSL1 那时候的无缝网络体验了,并且 Windows 防火墙也能过滤 WSL 里的包了,再也不需要什么桥接...
WSL2 使用 Window 的网络 在"C:\Users\xxx.wslconfig"中写入以下内容然后保存: [experimental]autoMemoryReclaim=gradual # 可以在 gradual 、dropcache 、disabled 之间选择networkingMode=mirroreddnsTunneling=truefirewall=trueautoProxy=truesparseVhd=true ...