microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.34k stars 814 forks source link

[QUESTION] Add a second vEthernet adapter for specific WSL distro #7690

Open pieterhouwen opened 2 years ago

pieterhouwen commented 2 years ago

Is your feature request related to a problem? Please describe. I'm running multiple WSL instances but I want to bridge a certain distro to my local network while leaving another one with the default network setting (seperate network adapter). I read online that you can hook up your WSL installation to the local network by creating a network bridge between the vEthernet adapter for WSL and the adapter that is connected to your local network (in my case Local Area Connection). This however turns network bridging on for every WSL distro you have installed, and some features of the distro that I don't want bridged stop working when the network is bridged.

Describe the solution you'd like I'd like to know how I can create a seperate vEthernet adapter which I can bridge to the local network that only works for a specific WSL distro. Or I'd like to know how I can turn on network bridging for a specific distro.

micheldiemer commented 5 months ago

Here a detailed working procedure on how to use WSLAttachSwitch

Script : https://github.com/microsoft/WSL/issues/4799#issuecomment-2065450904

Text : https://github.com/microsoft/WSL/issues/4799#issuecomment-2065456777

micheldiemer commented 5 months ago

https://github.com/skorhone/wsl2-custom-network might help you