{"id":226,"date":"2024-12-12T22:56:54","date_gmt":"2024-12-13T05:56:54","guid":{"rendered":"https:\/\/eisaichen.com\/?p=226"},"modified":"2025-04-07T12:55:04","modified_gmt":"2025-04-07T19:55:04","slug":"fix-poor-network-performance-when-using-hyper-v-external-network-with-wi-fi-adapter","status":"publish","type":"post","link":"https:\/\/eisaichen.com\/?p=226","title":{"rendered":"Fix poor network performance when using Hyper-V external network with Wi-Fi adapter"},"content":{"rendered":"\n<p>If you bridge a Wi-Fi adapter to Hyper-V as I do<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"974\" src=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1024x974.png\" alt=\"\" class=\"wp-image-227\" srcset=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1024x974.png 1024w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-300x285.png 300w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-768x731.png 768w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image.png 1444w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You may notice a significant drop in upload speed, which makes it difficult to transfer any file out of your computer. This has an effect on the host and your VMs.<\/p>\n\n\n\n<p>More precisely, is the retransmission rate skyrockets, your NIC needs to retransmit many times to send a single packet out.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"625\" src=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-1024x625.jpg\" alt=\"\" class=\"wp-image-228\" srcset=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-1024x625.jpg 1024w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-300x183.jpg 300w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-768x469.jpg 768w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-1536x938.jpg 1536w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/YG02GRP8FY_XTS1C6-2048x1251.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To fix this, we simply need to disable all offload features for our virtual network adapter.<br><strong>Is the virtual network adapter on host, NOT the physical network adapter.<\/strong><br>You don&#8217;t need to change any thing for your physical network adapter.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix for Host and Windows VMs<\/h2>\n\n\n\n<p>For example, the wifi adapter I use for Hyper-V is<br><code><kbd>Intel(R) Wi-Fi 6E AX211 160MHz<\/kbd><\/code><br>And the associate virtual network adapter is<br><kbd>Hyper-V Virtual Ethernet Adapter #3<\/kbd><\/p>\n\n\n\n<p>You can check it by using this command<br><code>Get-NetAdapter<\/code><\/p>\n\n\n\n<p>Next, open <kbd>Device Manager<\/kbd> and open the properties of your <strong>virtual NIC<\/strong>, open tab &#8220;Advanced&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"910\" src=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1.png\" alt=\"\" class=\"wp-image-229\" srcset=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1.png 800w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1-264x300.png 264w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1-300x341.png 300w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-1-768x874.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Disable the following options:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Large Send Offload V1 (IPv4)   # If exist\nLarge Send Offload V2 (IPv4)\nLarge Send Offload V2 (IPv6)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># powershell\n\n<code>Get-NetAdapter<\/code>\nSet-NetAdapterAdvancedProperty -Name \"vEthernet (Hyper-V Wi-Fi)\" -RegistryKeyword \"*LsoV1IPv4\" -RegistryValue \"0\"\nSet-NetAdapterAdvancedProperty -Name \"vEthernet (Hyper-V Wi-Fi)\" -RegistryKeyword \"*LsoV2IPv4\" -RegistryValue \"0\"\nSet-NetAdapterAdvancedProperty -Name \"vEthernet (Hyper-V Wi-Fi)\" -RegistryKeyword \"*LsoV2IPv6\" -RegistryValue \"0\"<\/code><\/pre>\n\n\n\n<p>That&#8217;s it, Your wifi performance should now be back to normal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fix for Linux VMs<\/h2>\n\n\n\n<p>Create a script file with the following code<br><kbd>\/usr\/local\/sbin\/disable-offloading.sh<\/kbd><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Change this to your virtual NIC that is using hosts wifi\nINTERFACE=\"eth0\"\n\nethtool -K $INTERFACE tso off<\/code><\/pre>\n\n\n\n<p>Run it<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod +x \/usr\/local\/sbin\/disable-offloading.sh\nsudo \/usr\/local\/sbin\/disable-offloading.sh<\/code><\/pre>\n\n\n\n<p>And now your VM should have full performance with wifi.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"364\" src=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-2-1024x364.png\" alt=\"\" class=\"wp-image-230\" srcset=\"https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-2-1024x364.png 1024w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-2-300x107.png 300w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-2-768x273.png 768w, https:\/\/eisaichen.com\/wp-content\/uploads\/2024\/12\/image-2.png 1462w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you want to auto run the script on system starts, you can use <kbd>rc.local<\/kbd> file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo '#!\/bin\/bash -e' &gt;&gt; \/etc\/rc.local\necho '\/usr\/local\/sbin\/disable-offloading.sh' &gt;&gt; \/etc\/rc.local\nsudo chmod +x \/etc\/rc.local<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you bridge a Wi-Fi adapter to Hyper-V as I do You may notice a significant drop in upload speed, which makes it difficult to transfer any file out of your computer. This has an effect on the host and your VMs. More precisely, is the retransmission rate skyrockets, your NIC needs to retransmit many [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":227,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226"}],"version-history":[{"count":5,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":250,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions\/250"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=\/wp\/v2\/media\/227"}],"wp:attachment":[{"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eisaichen.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}