I have a ubuntu 16.04 LTS guest VM running inside HyperV on Win10 pro v1803 (build 17134.345). The guest does have internet connectivity through a Virtual Ethernet Adapter NAT on the host, but internet TCP connections are very slow (<5KB/s). The host itself is on wifi, and achieves MB/s connections commonly. How can I improve the performance of the guest traffic ?
The VM is on two different IPV4 networks.I've not configured IPv6, and it is the only VM running.
guest eth0 is on
192.168.20.200/24. In HyperV, this interface is connected to a VSwitch with the host, for host-vm traffic. The max bandwidth on that link is high, and matches expectations. Latency with the host is <1ms.
guest eth1 is on
192.168.30.200/24. In HyperV, his interface is connected to a NAT VSwitch, and provides internet connectivity to the VM. The bandwidth on that link, from the VM's perspective is very slow, i.e. ~5 KByte/s sustained download speeds. Latency, on the other hand, is similar to the host's, in the 8-9ms range for internet pings.
The VNat on the host was created with powershell, using steps described in this Microsoft article
I have disabled offloading features on the guest to see if that boosted the max bandwidth, with the following commands:
for i in rx tx sg tso ufo gso gro lro rxvlan txvlan rxhash; do sudo ethtool --offload eth1 "$i" off done
But it did not improve guest internet speeds. I did not notice any effect. I've tried rebooting the host, and the VMs, disabling and re-enabling the NAT interface, but that didn't perceptibly improve anything either.
In powershell, Get-NetAdapter reports the following basic info for the vSwitch:
vEthernet (vNAT) Hyper-V Virtual Ethernet Adapter #6 19 Up 00-15-5D-02-E8-0F 10 Gbps
TCP connections will quickly fall below 5KB/s. Apt-get can sit for hours on small packages:
0% [3 InRelease 104 kB/109 kB 95%] 2,889 B/s ... Fetched 323 kB in 1min 1s (5,280 B/s)
At home, speedtest-cli on the guest at home reports 1.91Mbps down, 13.02Mbps up. On the host it's 80Mbps down, 20Mbps up.
At the university, speedtest-cli on the guest reports 5.9Mbps down, 8.41Mpbs up. On the host, 112.53 Mbps down, 154.13 mbps up.
The guest kernel is Ubuntu 16.04 (xenial)
Linux host 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux. This kernel appears to come builtin with drivers for hyperv if I am to believe this list.