Forwarding is disabled by default:
Get-NetIPInterface | Select-Object ifIndex,InterfaceAlias,ConnectionState,Forwarding
ifIndex InterfaceAlias ConnectionState Forwarding
------- -------------- --------------- ----------
57 vEthernet (WSL (Hyper-V firewall)) Connected Disabled
38 vEthernet (Default Switch) Connected Disabled
17 Ethernet 2 Disconnected Disabled
14 Local Area Connection* 10 Disconnected Disabled
22 Local Area Connection* 9 Disconnected Disabled
18 OpenVPN Connect DCO Adapter Disconnected Disabled
7 Wi-Fi Connected Disabled
5 Local Area Connection Disconnected Disabled
1 Loopback Pseudo-Interface 1 Connected Disabled
57 vEthernet (WSL (Hyper-V firewall)) Connected Disabled
38 vEthernet (Default Switch) Connected Disabled
17 Ethernet 2 Disconnected Disabled
14 Local Area Connection* 10 Disconnected Disabled
22 Local Area Connection* 9 Disconnected Disabled
18 OpenVPN Connect DCO Adapter Disconnected Disabled
7 Wi-Fi Connected Disabled
5 Local Area Connection Disconnected Disabled
1 Loopback Pseudo-Interface 1 Connected Disabled
Enable it in PowerShell as Administrator:
Get-NetIPInterface | where {$_.InterfaceAlias -eq 'vEthernet (WSL (Hyper-V firewall))' -or $_.InterfaceAlias -eq 'vEthernet (Default Switch)'} | Set-NetIPInterface -Forwarding Enabled
Check if it is enabled:
Get-NetIPInterface | Select-Object ifIndex,InterfaceAlias,ConnectionState,Forwarding
ifIndex InterfaceAlias ConnectionState Forwarding
------- -------------- --------------- ----------
57 vEthernet (WSL (Hyper-V firewall)) Connected Enabled
38 vEthernet (Default Switch) Connected Enabled
17 Ethernet 2 Disconnected Disabled
14 Local Area Connection* 10 Disconnected Disabled
22 Local Area Connection* 9 Disconnected Disabled
18 OpenVPN Connect DCO Adapter Disconnected Disabled
7 Wi-Fi Connected Disabled
5 Local Area Connection Disconnected Disabled
1 Loopback Pseudo-Interface 1 Connected Disabled
57 vEthernet (WSL (Hyper-V firewall)) Connected Enabled
38 vEthernet (Default Switch) Connected Enabled
17 Ethernet 2 Disconnected Disabled
14 Local Area Connection* 10 Disconnected Disabled
22 Local Area Connection* 9 Disconnected Disabled
18 OpenVPN Connect DCO Adapter Disconnected Disabled
7 Wi-Fi Connected Disabled
5 Local Area Connection Disconnected Disabled
1 Loopback Pseudo-Interface 1 Connected Disabled
Access Hyper-V from WSL:
ping 172.29.253.102
PING 172.29.253.102 (172.29.253.102) 56(84) bytes of data.
64 bytes from 172.29.253.102: icmp_seq=1 ttl=127 time=0.606 ms
64 bytes from 172.29.253.102: icmp_seq=2 ttl=127 time=0.685 ms
64 bytes from 172.29.253.102: icmp_seq=3 ttl=127 time=0.633 ms
64 bytes from 172.29.253.102: icmp_seq=4 ttl=127 time=0.786 ms
64 bytes from 172.29.253.102: icmp_seq=5 ttl=127 time=1.45 ms
64 bytes from 172.29.253.102: icmp_seq=6 ttl=127 time=1.11 ms
64 bytes from 172.29.253.102: icmp_seq=7 ttl=127 time=1.11 ms
64 bytes from 172.29.253.102: icmp_seq=8 ttl=127 time=0.674 ms
64 bytes from 172.29.253.102: icmp_seq=9 ttl=127 time=1.29 ms
64 bytes from 172.29.253.102: icmp_seq=10 ttl=127 time=0.870 ms
64 bytes from 172.29.253.102: icmp_seq=11 ttl=127 time=1.34 ms
64 bytes from 172.29.253.102: icmp_seq=12 ttl=127 time=0.795 ms
64 bytes from 172.29.253.102: icmp_seq=13 ttl=127 time=1.54 ms
64 bytes from 172.29.253.102: icmp_seq=14 ttl=127 time=0.684 ms
64 bytes from 172.29.253.102: icmp_seq=15 ttl=127 time=0.868 ms
64 bytes from 172.29.253.102: icmp_seq=16 ttl=127 time=1.31 ms
64 bytes from 172.29.253.102: icmp_seq=17 ttl=127 time=0.802 ms
or
telnet 172.29.253.102 389
Performance
Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors
Name NumberOfCores NumberOfLogicalProcessors
---- ------------- -------------------------
13th Gen Intel(R) Core(TM) i7-13700H 14 20
Allowing Windows Subsystem for Linux to communicate with Hyper-V VMs
https://automatingops.com/allowing-windows-subsystem-for-linux-to-communicate-with-hyper-v-vms
Connect Hyper-V VM from WSL (Ubuntu)
https://stackoverflow.com/a/75684131/2394762