MustardChef / WSABuilds

Run Windows Subsystem For Android on your Windows 10 and Windows 11 PC using prebuilt binaries with Google Play Store (MindTheGapps) and/or Magisk or KernelSU (root solutions) built in.
GNU Affero General Public License v3.0
7.71k stars 1.3k forks source link

[BUG]There is UNEXPECTED WiFi option in v2307.40000.5.0_x64_Release-Nightly-MindTheGapps-13.0-RemovedAmazon #165

Closed Snowlights2022 closed 5 months ago

Snowlights2022 commented 1 year ago

Describe the bug | 描述一下这个错误

I apologise for some screenshots without English. I added detailed descriptions in English to solve the problem.

屏幕截图 2023-08-26 232925 屏幕截图 2023-08-26 232940

The screenshot was made when WSA cannot connect to Internet.It shows a option ui different from repo's help.There is no VirtWiFi and Internet. I apologise for I didn't make a screenshot when WSA can connect to Internet. At that time, it shows Fake WiFi or nothing, just like screenshot above.

Steps to reproduce the issue | 重现该问题的步骤

Advanced setting->Manage developer setting->click search->search WIFI->click WIFI->See the screenshot above

Expected behaviour | 预期的行为

261492585-852d8075-69aa-45f1-9ca6-57cff0eefa73 Just like screenshot above, and WSA can connect to Internet sucessfully.

Downloaded Build Of WSA | 已下载的WSA版本

VERSION: v2307.40000.5.0_x64_Release-Nightly-MindTheGapps-13.0-RemovedAmazon SOURCE: just from this repo's realease.

Windows build number | Windows构建号

10.0.22631 Build22631.2262 ni_release

PC Specification | 个人电脑规格

屏幕截图 2023-08-26 230103 屏幕截图 2023-08-26 230210

Additional context | 额外的背景

At the same time, WSL uses virtual network adapter WSL for Internet. That is also internal, but different form WSA, it works. It seems like a bridged network? Once I confirmed it, I will attach details here. I think there is wrong settings for WSLCore , but I don't know how to find it.

Snowlights2022 commented 1 year ago

I want to add that the official WSA 2307.40000.5.0 from ms store works without such problem on my laptop.

arishwin commented 1 year ago

here is the screenshot with FakeWifi: image

However, I would like to add, that after I click on that, it does not appear in the WiFi settings: image

And saved networks shows that VirtWifi is disconnected: image

Snowlights2022 commented 1 year ago

There may be bugs from official WSA about this condition. But it seems still unsolved now in v2308. I will stay at v2306 until Microsoft fixed the bug or I get a easier way to alleviate this problem.

MustardChef commented 12 months ago

There may be bugs from official WSA about this condition. But it seems still unsolved now in v2308. I will stay at v2306 until Microsoft fixed the bug or I get a easier way to alleviate this problem.

@Snowlights2022 Does the internet work on the official 2308 builds of WSA?

From what I have found, disabling your Antivirus Firewall and using Windows Firewall may fix internet issues in some cases. Please could you try this if this applies to you.

d0j1a1701 commented 6 months ago

It seems that this issue is related to the proxy tool (for me, Clash Meta).

When you use a proxy, the system seems to automatically apply the proxy to WSL, this behavior is called "autoproxy", here is the configuration in my C:/Users/<omit>/.wslconfig:

[experimental]
autoMemoryReclaim=gradual  # gradual | dropcache | disabled
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true

In this case, WSL will automatically set up an agent consistent with the host, and the Hyper-V Manager shows the WSL virtual switch in "internal" state. Testing has shown that all traffic from WSL goes through the agent.

However, WSA does not seem to automatically set up a proxy. The Hyper-V Manager shows that the WSA virtual switch is in "internal" state, but the WSA settings indicate that there is no Wi-Fi connection and internet access is not available.

So I tried to manually set up a proxy by running the following command in Powershell to manually set WSA to use a host proxy:

$WinNetIP=$(Get-NetIPAddress -InterfaceAlias 'vEthernet (Default Switch)' -AddressFamily IPV4)
adb connect 127.0.0.1:58526
adb shell settings put global http_proxy "$($WinNetIP.IPAddress):7890"

After the issue was resolved, all traffic from WSA went through the host proxy via the "FakeWifi" network.

d0j1a1701 commented 6 months ago

Also, I hope developers can add an option to automatically execute a script to set up a proxy after WSA starts.

MustardChef commented 6 months ago

@d0j1a1701 Thank you, we will consider this for our WSAUtilities project. So just to confirm, you were able to successfully set up a proxy with WSA without any issues to the internet. (Most people attempting to use any kind of proxy lose internet access after/when it is applied).

d0j1a1701 commented 6 months ago

@MustardChef Yes. The proxy client Clash Meta I use on Windows exposes a mixed type proxy of http/socks5 on 0.0.0.0:7890, all my configurations above are based on this.

d0j1a1701 commented 6 months ago

@MustardChef I don't know if it's possible to make WSA use the same "mirror" network mode as WSL

Or manually specify the virtual switch used by WSA (such as "Default Switch")

d0j1a1701 commented 6 months ago

Update: I used the "Auto-run script" feature of KernalSU and placed the executable autoproxy.sh in /data/adb/boot-completed.d.

settings put global http_proxy "http://127.0.0.1:7890"

Solved the problem.

MustardChef commented 6 months ago

@MustardChef Yes. The proxy client Clash Meta I use on Windows exposes a mixed type proxy of http/socks5 on 0.0.0.0:7890, all my configurations above are based on this.

Does the proxy persist after restart?

d0j1a1701 commented 6 months ago

@MustardChef Yes. The proxy client Clash Meta I use on Windows exposes a mixed type proxy of http/socks5 on 0.0.0.0:7890, all my configurations above are based on this.

Does the proxy persist after restart?

No, that's why I have to use KernalSU to execute a script everytime startup, in order to automatically set the proxy.

d0j1a1701 commented 6 months ago

In addition, you should enable "Local Network Access" in the WSA advanced settings and set/add a switch named "vSwitch (WSL)" in the Hyper-V Manager and set it to the network card you are using, so that you can access the proxy on the host using 127.0.0.1.

rahaaatul commented 3 months ago

In addition, you should enable "Local Network Access" in the WSA advanced settings and set/add a switch named "vSwitch (WSL)" in the Hyper-V Manager and set it to the network card you are using, so that you can access the proxy on the host using 127.0.0.1.

How do I add a switch in Hyper-V Manager?

I don't see FakeWifi or VirtWifi in WSA.