When dealing with Hyper-V virtual machines, one peculiar scenario often frustrates developers: transferring files between host and guest OS when both are using the same physical network adapter through a vSwitch bridge. The expected gigabit speeds mysteriously degrade to dial-up era performance.
The root cause lies in how Windows handles loopback traffic for bridged connections. Unlike normal network traffic, the data path becomes:
Physical NIC → vSwitch → Host OS Network Stack → vSwitch → Physical NIC
This creates unnecessary overhead and TCP congestion control triggers due to the artificial loop.
Option 1: Use Internal Network Switch
# PowerShell command to create internal switch New-VMSwitch -Name "InternalTransfer" -SwitchType Internal
Then assign static IPs on a non-conflicting subnet (e.g., 192.168.137.0/24) to both host and VM.
Option 2: Enable Jumbo Frames
# On both host and VM: Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Jumbo Packet" -DisplayValue "9014 Bytes"
Option 3: Disable TCP Offloading
# PowerShell commands to disable offloading features Disable-NetAdapterChecksumOffload -Name "Ethernet" -Ipv4 -Ipv6 -Tcp Disable-NetAdapterRsc -Name "Ethernet"
For developers needing frequent transfers:
- Use
robocopy
with multithreading:robocopy C:\source \\VM-NAME\destination /MT:16 /R:1 /W:1
- Set up an HTTP server in the VM:
python -m http.server 8000
- Configure SMB Direct (requires RDMA-capable NICs)
After implementing changes, verify throughput with:
# On host: iperf3 -s # On VM: iperf3 -c host-ip -t 30 -P 8
Expect >900Mbps on modern hardware with proper configuration.
When transferring files between my Windows 8 host and Windows Server 2012 VM, I observed bizarre speed degradation from 300KB/s down to snail-paced 20KB/s. Both systems shared the same physical NIC through a bridged vSwitch configuration with correctly assigned IPs on the same subnet. Let me walk through the diagnostic journey.
First, verify your virtual switch configuration with PowerShell:
Get-VMSwitch | Select Name, SwitchType, NetAdapterInterfaceDescription
Get-VMNetworkAdapter -VMName YourVMName | Select Name, SwitchName, IPAddresses
Common misconfigurations include:
- Using the legacy "External" switch type instead of "Default"
- MTU mismatches between host and VM
- Incorrect bandwidth reservation settings
Apply these registry tweaks on both systems:
# Disable TCP autotuning
[HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"EnableRSS"=dword:00000000
"EnableTCPA"=dword:00000000
# Optimize Hyper-V network adapter
[HKLM\SYSTEM\CurrentControlSet\Services\VMSMP\Parameters]
"MaxRxBuffers"=dword:00004000
"RxRingBufferFrames"=dword:00000200
When standard file copying fails, consider these approaches:
# PowerShell remoting
Invoke-Command -VMName YourVM -ScriptBlock {
Copy-Item -Path "\\host\share\largefile.iso" -Destination "C:\temp"
}
# SMB direct configuration
Set-SmbClientConfiguration -EnableBandwidthThrottling 0 -Force
Set-SmbServerConfiguration -EncryptData $false -Force
For physical hosts, ensure:
- VMQ (Virtual Machine Queue) is disabled in NIC properties
- Receive Side Scaling (RSS) is properly configured
- No power saving features are active on the network adapter
Run this network health check:
Test-NetConnection -ComputerName VM_IP -Port 445
Get-NetAdapter | Where Status -eq "Up" | Get-NetAdapterAdvancedProperty
Get-NetTCPSetting | Where SettingName -eq "Internet" | Select *