Tunnel mode
Use tunnel mode when the Mac's traffic goes through a VPN or a proxy app and the guest's traffic must go the same way. In nat and bridged, the guest's packets bypass the VPN.
Turn it on
Stop the machine, then:
In Launchpad, pick tunnel in the Network section of the machine's Settings…. The bundle must list tunnel in vphone-cli vm config --help; an older bundle rejects it.
Check that it works
-
Start the machine and wait for it to finish booting.
-
Read the guest's address:
en0should show192.168.127.3. If it shows only anfe80::address, DHCP has not finished yet. Wait a few seconds and try again. -
Open a page in the guest:
-
On the Mac, check that the connections belong to
vphone-vmand use the VPN's address:
What the guest sees
In a proxy app the guest shows up as its own client, named after the machine, and the app's rules apply to it as to any other app.
Limits
- IPv4 only. The guest gets no IPv6 address, and IPv6 traffic is dropped.
- Outbound only, apart from forwarded ports. Nothing on the Mac or the LAN can reach the guest through this network except the ports listed under Port forwarding. USB access (
iproxy,ideviceinstaller) andvphone.sockdo not use the guest network, so they still work. A.localname also reaches the guest over its USB link; see Names on the network. - Ping reaches the gateway only. ICMP to the internet is not forwarded, so
ping 1.1.1.1in the guest fails even while TCP and UDP work. - Throughput is limited by
vphone-vm. Every packet is handled in that process. Downloads and video work, butnatis faster when no VPN is involved.
How it works
When a VPN owns the Mac's default route (WireGuard, Cloudflare WARP, or a proxy app in TUN mode such as Surge or Clash), packets that nat and bridged send out through a physical interface skip the VPN. They leave unencrypted, or not at all.
In tunnel mode the guest's network card is implemented inside vphone-vm. It answers DHCP, ARP and ping for the gateway, and turns each guest TCP connection and UDP flow into a normal socket on the Mac. Those sockets follow the Mac's routing table like any other app's, so the VPN carries them. It needs no root, no new network interface and no change to the Mac's network settings.