-
Notifications
You must be signed in to change notification settings - Fork 822
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
allow us to specify hyper-v virtual switch network adapter for wsl2 #5835
Comments
/dupe #4467 |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
@therealkenc please reconsider, i called out #4467 as it is a related issue but this is asking for a very specific solution that has different implications |
+1 Please reopen! |
This seems like a trivial feature for great benefit. It doesn't introduce a new concept but rather allows override of a default behavior and hence won't burden anyone relying on the current behavior; virtualSwitch="Default Switch". Please reconsider this optional 'virtual switch' setting either via the command line (precedence) or /etc/wsl.conf:
|
I'm also affected by this bug, do not consider it a feature, and am prevented from using WSL "for real" by it :-/ The time at which Hyper-V decides which IP networks aren't conflicting is not the time I have all of them active. Please allow selection of a static network for WSL2. |
The WSL-managed switch simply doesn't work for me, and I'm having trouble figuring out how to modify it. I would appreciate having an option to create my own and just tell WSL to use it. Can we re-open this feature request? |
You're welcome #7395 |
Also affected by this. Apache logs show the virtual network address of the adapter instead of the actual visitor ip, and I can only get them if I have a cloudflare domain and mod_remoteip enabled (with RemoteIPTrustedProxy for 172.17.32.0/20 as well). The problem with this is if you connect to apache with my actual IP or any other domain pointing towards my IP, it shows the 172 addresses again. The way to get them back would be to make a DNAT and have WSL use that switch, which this thread proves is pretty tedious. Please reopen. |
this doesn`t work
|
this working for me |
I've written extensive tutorial in the other issue, so here's the link: Esit: to clarify, I'd like to point everyone to the fact that vSwitch can now be used to directly connect WSL2 distro, officially, no hacks, using "networkingMode=bridged". You do need W11 Pro, which shouldn't be an issue. I've compiled a nice big tutorial couple of days ago as a comment in main networking thread: Likewise added it to my GitHub: I went through W10 to W11 upgrade (linked instructions for those with "unsupported" hardware), WSL2 Preview, creation of vSwitch, configuration of a bridge, and as a bonus systemd configuration on Ubuntu with complete systemd based networking setup. It should be doable for both newbies and experienced users. Btw, I can now tear up and setup new WSL2 instance with proper networking and full apt upgrades and all in less than 10 minutes, easy-peasy. |
Is your feature request related to a problem? Please describe.
I'm in a corporate environment and my windows defender is very restricted. I do get to own the 172.18.0.0/16 address space. We use this for our docker desktop stuff so we can have things talk, and i want to do the same for my WSL2 but there doesn't seem to be a way to tell WSL to use that space. Every reboot it just randomly picks something from 172.16.0.0/10 or 192.168.0.0/24 it seems and i can't change it.
Describe the solution you'd like
I want to be able to do wsl --set-default-switch "JRS WSL"
this would be after i do something like:
then any WSL instances after launch would use that network and get an ip from 172.18.5.0/24
Describe alternatives you've considered
There's a lot of issues related to this out there:
Additional context
Is there some guidance on how we can have our corporate GPO setup so that windows defender doesn't get in the way of internal network adapters? They have NO net connection profile...can GPO target them by that + internal? That'd be another way to solve this
The text was updated successfully, but these errors were encountered: