Set-VMSwitch WSL -NetAdapterName "以太网 2" # 这里的“以太网 2”是你自己实际的物理网卡。 wsl-linux执行 sudo ip addr del $(ip addr show eth0 | grep 'inet\b' | awk '{print $2}' | head -n 1) dev eth0 sudo ip addr add 192.168.2.33/24 broadcast 192.168.2.255 dev eth0 sudo i...
networkingMode=bridged vmSwitch=WSL_external dhcp=false # 禁止DHCP动态分配IP地址 ipv6=true # Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB #可更改 memory=4GB # Sets the VM to use two virtual processors #可更改 processors=2 (2)新增Linux...
vmSwitch = wan swap = 8GB memory = 6GB wsl.conf 在/etc/wsl.conf 中设置不生成hostname、Resolv,之后单独定义 [boot] systemd=true [network] generateHosts = false generateResolvConf = false hostname=wsl 网络设置 参考大佬思路,建bash脚本,通过profile调用来设置静态网络 setwsl2bridge.sh #!/bin/sh...