wsl2-boot icon indicating copy to clipboard operation
wsl2-boot copied to clipboard

Boot script fails when $dnsIP is empty (VPN disabled)

Open RicoFactset opened this issue 3 years ago • 1 comments

Hello,

Situation: VPN disabled

Log:

Booting Ubuntu-20.04 distribution with WslSubnetPrefix 192.168.50, WslHostIP 192.168.50.2 ...
/boot/wsl-boot.sh: Option -n needs a parameter

 Syntax: /boot/wsl-boot.sh [-h|options]

 options:
	 -p WslSubnetPrefix
	 -g GatewayIP
	 -i WslHostIP
	 -n DnsServer
	 -s DnsSearch
	 -m NlMtuSize
wsl-boot completed !
Press any key to continue . . . 

In line https://github.com/ocroz/wsl2-boot/blob/master/windows/wsl-boot.ps1#L99 $dnsIp is expected to further pass it to /boot/wsl-boot.sh.

The /boot/wsl-boot.sh script complains as the value is empty.

In line https://github.com/ocroz/wsl2-boot/blob/master/windows/VpnEx.ps1#L49 $dnsIP should get the value from $GatewayIP: wsl $d $distribution --list --running >$null; if ($?) { $dnsIP = $GatewayIP } This never happens.

Output of the wsl -d Ubuntu-20.04 --list --running > $null command:

Windows Subsystem for Linux Distributions: Ubuntu-20.04 (Default)

RicoFactset avatar Feb 10 '22 08:02 RicoFactset

Hi, I'm sorry I have not considered your issue. I think I made a change that fixed the issue you described. Do you confirm this problem is gone?

ocroz avatar Jul 05 '22 20:07 ocroz

Closing as no feedback.

ocroz avatar Dec 21 '22 12:12 ocroz