You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created multiple WSL2 VMs based on the latest ubuntu distro appx.
Whenever I change the IP address of one, it changes the IP address of them all.
PS C:\ [06:10:54]> wsl -l -v
NAME STATE VERSION
* kali-linux Stopped 2
ubuntu_control Stopped 2
ubuntu_workernode1 Stopped 2
ubuntu_baseline Stopped 2
docker-desktop Running 2
docker-desktop-data Stopped 2
ubuntu_workernode2 Stopped 2
ubuntu_workernode3 Stopped 2
PS C:\ [06:13:46]> Install-WslIpHandler -WslInstanceName ubuntu_control -GatewayIpAddress 192.168.143.1 -WslInstanceIpAddress 192.168.143.111
PowerShell installing Wsl-IpHandler to ubuntu_control...
Test of Wsl-IpHandler Installation on ubuntu_control Succeeded!
PowerShell successfully installed Wsl-IpHandler to ubuntu_control.
PS C:\ [06:14:01]> wsl -d ubuntu_control hostname -I
192.168.143.111
PS C:\ [06:14:25]> Install-WslIpHandler -WslInstanceName ubuntu_workernode1 -GatewayIpAddress 192.168.143.1 -WslInstanceIpAddress 192.168.143.112
PowerShell installing Wsl-IpHandler to ubuntu_workernode1...
Test of Wsl-IpHandler Installation on ubuntu_workernode1 Succeeded!
PowerShell successfully installed Wsl-IpHandler to ubuntu_workernode1.
PS C:\ [06:15:08]> wsl -d ubuntu_workernode1 hostname -I
192.168.143.112
PS C:\ [06:14:01]> wsl -d ubuntu_control hostname -I
192.168.143.112
PS C:\ [06:16:05]> wsl -d ubuntu_workernode2 hostname -I
Settings 'appendWindowsPath' in [interop] section is disabled in /etc/wsl.conf!
This setting must be enabled for Wsl-IpHandler to work. Please confirm if you want to continue:
[F] Fix [N] No [Y] Yes [?] Help (default is "F"): f
192.168.143.112
PS C:\ [06:16:27]> wsl -d ubuntu_workernode3 hostname -I
Settings 'appendWindowsPath' in [interop] section is disabled in /etc/wsl.conf!
This setting must be enabled for Wsl-IpHandler to work. Please confirm if you want to continue:
[F] Fix [N] No [Y] Yes [?] Help (default is "F"): f
192.168.143.112
PS C:\ [06:16:31]> wsl -d kali-linux hostname -I
cat: /etc/wsl.conf: No such file or directory
192.168.143.112
If I start an interactive shell with -d, the IP of all of the WSL2 VMs changes to the IP address of the last VM I've started a shell in.
It appears that this is discussed in detail with an example here. Note that as in, this only allows traffic to be routed across the bridge, which exists within the subsystem, therefore I don't believe it's accessible via a vSwitch in ICS.
Alone, this is still valuable. Can this be implemented?
The text was updated successfully, but these errors were encountered:
On the page you linked there is an answer that outlines the reasons why this odd behavior you noticed is happening.
This is a WSL quirk, that this module cannot solve on its own.
And my understanding is that in essence there is choice to make:
Work with each WSL instance separately (i.e. all other instances must be stopped) and have full network connectivity;
Make multiple WSL instances working together "under a bridge", but sacrifice external connectivity.
The module as it is now is opting for option 1.
Whether option 2 can be a feature the module can offer remains to be seen as it seems like a drastic change of some of the internals. At the very least what you can do is replace content of /usr/local/bin/wsl-iphandler.sh script at all WSL instances with the one in the link you posted and it will provide you the functionality you are looking for.
I've created multiple WSL2 VMs based on the latest ubuntu distro appx.
Whenever I change the IP address of one, it changes the IP address of them all.
If I start an interactive shell with
-d
, the IP of all of the WSL2 VMs changes to the IP address of the last VM I've started a shell in.It appears that this is discussed in detail with an example here. Note that as in, this only allows traffic to be routed across the bridge, which exists within the subsystem, therefore I don't believe it's accessible via a vSwitch in ICS.
Alone, this is still valuable. Can this be implemented?
The text was updated successfully, but these errors were encountered: