Config Network Bridge for Windows Sandbox
This note is synced from my github blog. Published on 7th March 2024
Rambling Time
Because it's rumored online that Tencent apps like WeChat scan your hard drive, I decided to run WeChat in a sandbox (Windows Sandbox).
However, while using WeChat, I needed to back up chat history to my computer. And WeChat requires the computer and phone to be on the same network. So, I had to manually bridge them to put both on the same subnet.
For some reason, my laptop couldn't just follow the MS online tutorial: select two network adapters and click bridge. After bridging, neither side could access the internet. After some tinkering, I finally found a method that works.
Also, my system is Windows 10. We're in the Windows 11 era now, so I can't guarantee this tutorial still works.
TL;DR: Restart your computer.
Steps
Step one: Open the network connections settings in Control Panel (you can get there by right-clicking the network icon at the bottom-right of the Start menu -> "Open Network & Internet settings" -> "Change adapter options"). Hold CTRL and select vEthernet (Default Switch) and the network adapter used for internet access (usually WLAN), then select "Bridge". At this point, a new adapter named "Network Bridge" should appear, and both the host and sandbox will show no network connection.

After bridging, the network can't connect, like this:

Step two: Select vEthernet (Default Switch), right-click and choose "Remove from Bridge".

At this point, the device and sandbox still can't connect to the network.
Step three: Restart your computer. After restarting, the network should be back to normal. If not, go into Wi-Fi settings and manually configure the IP. Wait a moment, and the network will probably recover. If not, restart again.
After I restarted my computer, the network recovered, as shown:

Step four: You should have just restarted your computer. Note that you need to open the sandbox first, then modify the host's configuration. After opening the sandbox, go to the host's Control Panel adapter settings, select vEthernet (Default Switch), right-click and choose "Add to Bridge". Wait a moment, and the sandbox should automatically adapt to the new network environment. If the sandbox shows no network connection, go into the sandbox's network settings and manually configure the IP. Wait a moment, and the network will probably recover. If not, go to the host's Control Panel adapter settings, right-click to remove vEthernet (Network Bridge) from the bridge, and try bridging again.
As shown, I've successfully bridged at this point:

Reverting?
Just delete the network bridge directly from the host's Control Panel.

And then it's all good!