microsoft / WSA

Developer-related issues and feature requests for Windows Subsystem for Android
MIT License
1.52k stars 836 forks source link

Make IP address static for the vEthernet adapter on Windows host #457

Open peidaqi opened 11 months ago

peidaqi commented 11 months ago

Is your feature request related to a problem? Please describe

The IP address for the vEthernet adapter on Windows host & WSA changes every time WSA restarts. This creates a problem when trying to access Windows host from WSA.

Right now I'm trying to use WSA as an Android emulator for React Native development in WSL. For debugging and testing, React Native starts a HTTP server on WSL and the client App on the emulator needs to access this HTTP server.

I was able to forward the traffic using portproxy but it's quite a hassle to change the IP and set up firewall every time my system reboots.

Describe the solution you'd like

Similar to Windows Subsystem for Linux, the vEthernet adapter IP is static by default.

An even better solution would be to use the same subnet with WSL by default. I think it's reasonable to assume someone running both WSL and WSA on their computer would like to enable them to access each other.

Describe alternatives you've considered

No response

Please specify the version of Windows Subsystem for Android

2309.40000.8.0

jaholme commented 11 months ago

What is the experience if you enable "Local Network Access" in Windows Subsystem for Android settings > Advanced > Experimental features? Does this unblock the scenario?