23
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSL2でネットワークが遅いときの対処方法

Last updated at Posted at 2022-08-25

WSL2でネットワークが遅いときの対処方法

WSL2でネットワークが遅く、Docker pullやnpm installにすごく時間がかかる状態になったので原因を調査しました。

Hyper-V仮想LANの"Large Send Offload v2"を"Disabled"に変更すると直るとあったが、
この記事同様、デバイスマネージャーのネットワークアダプタにHyper-V仮想LANが存在しない。
記事を参考にIPv6をOffにしたが改善せず。
Windowsはバージョン上がるたびに設定方法をちょこちょこ変えるのやめてほしい。

を参考にDNSを8.8.8.8にしたが改善せず。

を参考に以下のコマンドを実行すると改善した

PS C:\WINDOWS\system32> ipconfig.exe /all
. . . .
イーサネット アダプター vEthernet (WSL):

   接続固有の DNS サフィックス . . . . .:
   説明. . . . . . . . . . . . . . . . .: Hyper-V Virtual Ethernet Adapter
   物理アドレス. . . . . . . . . . . . .: XX-XX-XX-XX-XX-XX
   DHCP 有効 . . . . . . . . . . . . . .: いいえ
. . . .
PS C:\WINDOWS\system32> Get-NetIPConfiguration "vEthernet (WSL)"


InterfaceAlias       : vEthernet (WSL)
InterfaceIndex       : 18
InterfaceDescription : Hyper-V Virtual Ethernet Adapter
IPv4Address          : 172.21.160.1
IPv6DefaultGateway   :
IPv4DefaultGateway   :
DNSServer            : fec0:0:0:ffff::1
                       fec0:0:0:ffff::2
                       fec0:0:0:ffff::3

PS C:\WINDOWS\system32> Get-NetAdapter -InterfaceIndex 18 | Get-NetAdapterAdvancedProperty

Name                      DisplayName                    DisplayValue                   RegistryKeyword RegistryValue
----                      -----------                    ------------                   --------------- -------------
vEthernet (WSL)           IPv4 Checksum Offload          Rx & Tx Enabled                *IPChecksumO... {3}
vEthernet (WSL)           IPSec Offload                  Auth Header and ESP Enabled    *IPsecOffloadV2 {3}
vEthernet (WSL)           Jumbo Packet                   Disabled                       *JumboPacket    {1514}
vEthernet (WSL)           Large Send Offload Version ... Disabled                       *LsoV2IPv4      {0}
vEthernet (WSL)           Large Send Offload Version ... Disabled                       *LsoV2IPv6      {0}
vEthernet (WSL)           Maximum Number of RSS Proce... 8                              *MaxRssProce... {8}
vEthernet (WSL)           Network Direct (RDMA)          Disabled                       *NetworkDirect  {0}
vEthernet (WSL)           Maximum Number of RSS Queues   8                              *NumRSSQueues   {8}
vEthernet (WSL)           Recv Segment Coalescing (IPv4) Enabled                        *RscIPv4        {1}
vEthernet (WSL)           Recv Segment Coalescing (IPv6) Enabled                        *RscIPv6        {1}
vEthernet (WSL)           Receive Side Scaling           Enabled                        *RSS            {1}
vEthernet (WSL)           RSS Base Processor Number      0                              *RssBaseProc... {0}
vEthernet (WSL)           Maximum RSS Processor Number   63                             *RssMaxProcN... {63}
vEthernet (WSL)           RSS Profile                    Closest Processor Static       *RSSProfile     {2}
vEthernet (WSL)           TCP Checksum Offload (IPv4)    Rx & Tx Enabled                *TCPChecksum... {3}
vEthernet (WSL)           TCP Checksum Offload (IPv6)    Rx & Tx Enabled                *TCPChecksum... {3}
vEthernet (WSL)           UDP Checksum Offload (IPv4)    Rx & Tx Enabled                *UDPChecksum... {3}
vEthernet (WSL)           UDP Checksum Offload (IPv6)    Rx & Tx Enabled                *UDPChecksum... {3}

PS C:\WINDOWS\system32> Set-NetAdapterAdvancedProperty -InterfaceDescription 'Hyper-V Virtual Ethernet Adapter' -DisplayName 'Large Send Offload Version 2 (IPv4)' -DisplayValue 'Disabled'

PS C:\WINDOWS\system32> Set-NetAdapterAdvancedProperty -InterfaceDescription 'Hyper-V Virtual Ethernet Adapter' -DisplayName 'Large Send Offload Version 2 (IPv6)' -DisplayValue 'Disabled'
23
15
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?