Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure with multiple WSL distro? #26

Closed
philippe-granet opened this issue May 14, 2021 · 3 comments
Closed

How to configure with multiple WSL distro? #26

philippe-granet opened this issue May 14, 2021 · 3 comments

Comments

@philippe-granet
Copy link

I have to work with multiple WSL distro running at same time.
Is it possible to use your script with more than one distro running at same time?

@albertony
Copy link
Contributor

Only one can run at a time, I think. At least you will have to configure different IP, named pipes etc..

What I do is to just run the vpnkit stuff from a single distro, and then other distros connects through the same by simply configuring them to go through the running vpnkit "nameserver":

/etc/wsl.conf:

[network]
generateResolvConf = false

/etc/resolv.conf:

nameserver 192.168.67.1

(may also add a second line with "nameserver 1.1.1.1" if you want this as fall-back).

A wsl.exe --terminate <distroname> or even wsl.exe --shutdown is usually needed for the DNS configuration to be properly applied.

@sakai135
Copy link
Owner

sakai135 commented May 14, 2021

It will work with multiple WSL 2 distros. With WSL 2, all the distros run within the same VM and share the network namespace. When you run wsl-vpnkit in one distro, you'll see that the eth1 and the updated default route in ip route will show in all distros. The only thing left to do would be setting the DNS server as @albertony mentioned.

If you're using the wsl-vpnkit.service script, you would want to use your default distro to run this or edit the script to specify the distro in the wsl.exe command.

@philippe-granet
Copy link
Author

Thank you for your explanations!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants