Open paul-vd opened 2 years ago
So the issue seems to be originating from my network adapter, when I connect using my WIFI network adapter (built-in) everything works as expected, but when I switch to my ASUS XG-C100F 10G SFP+ Network Adapter the issue starts.
I'm unsure how to further debug this problem to understand why it's happening on my network adapter, I'm open to any suggestions or even a debug session to maybe isolate the issue?
Did you try with this? It absolutely worked for me
https://townsyio.medium.com/wsl2-how-to-fix-download-speed-3edb0c348e29
I also experienced inconsistent and slow network speed with my ASUS XG-C100C.
Disabling IPv6 on the network adapter gave me expected network speeds in WSL2
@paul-vd What version of Windows/WSL are you running? There are a few reports of this issue going away in 22H2 (around version 10.0.22623.730 or later).
wsl --version
should give enough information.
@scovetta this was "resolved" after disabling IPv6.
Here is my version info:
WSL version: 0.70.0.0 Kernel version: 5.15.68.1 WSLg version: 1.0.45 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.674
I managed to "resolve" my super slow network issues in wsl2 in disabling ipv6.
My network device is a Marvell FastLinQ Edge 10Gbit Network Adapter
and wsl --version
outputs:
WSL version: 0.70.4.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.674
I tried everything and finally I could solve it:
/etc/resolv.conf
→ Not workingFinally I tried to disable IPv6 from the vEthernet of WSL and in W11 doesn't appears listed in the control panels, reading GitHub I found out that is because is a hidden device, from PowerShell I managed to disable it and right now WSL is has regular network speeds, the command:
Disable-NetAdapterBinding -Name "vEthernet (WSL)" -ComponentID ms_tcpip6 -IncludeHidden
I solved the problem by trying the following (Windows 11 Home).
Disable-NetAdapterLso -IncludeHidden -Name "vEthernet (WSL)"
Just restarting the WSL network adapter worked for me. Had 5Mbps upload speed, after restart back to normal speeds (>800Mbps)
In Administrator Powershell:
Restart-NetAdapter -Name "vEthernet (WSL)" -IncludeHidden
I have the same problem:
Testing download speed................................................................................
Download: 2.15 Mbit/s
Testing upload speed......................................................................................................
Upload: 287.43 Mbit/s
Nothing helped me, only reboot solved it. And it randomly appears again
For me restarting the WSL adapter does not work. What worked is deactivating the wifi adapter in windows network control panel and activating it again, then it gained full speed, until it worked again.
This works for me:
1- Press the Windows Key and type “Control Panel” and hit enter 2- Click “Network and Internet” 3- Click “View network status and tasks” 4- Click “Change adapter settings” 5- Find the “vEthernet (WSL)” adapter and click properties 6- Click “configure” and open the advanced tab
Note: 2 and 3 might be under "Network and Sharing Center" in the Control Panel
Select “Large Send Offload Version 2 (IPv4)” and change the drop-down to disabled. To the same for “Large Send Offload Version 2 (IPv6)”.
Once this is done click “OK” and you are all done. You may experience a slight downtime in connection while this is saved.
For those of you that can't easily disable the "Large Send Offload Version 2 (IPv4)" (or IPv6) because the WSL adapter is hidden in the control panel, here are the steps I took to disable this setting via powershell: (full disclosure: I have zero understanding/comprehension of what this setting does... so I'm essentially pressing buttons at random)
In PowerShell:
get-netadapter
This will give you a list of network adapters on your system:
Next, run the following command to view the advanced properties of the "vEthernet (WSL)" adapter:
Get-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" | Format-Table -AutoSize
Here, you can see that this setting had a value of 1, which I speculate maps to "enabled".
Next, change the value to "Disabled":
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled
.
I applied this change and network speed in my WSL environment seemed to have improved.
I woke up this morning and found that my Windows box had been "updated". I also saw that my WSL speeds were slow again. I opened up this thread and followed the steps in my previous post and immediately saw the download speeds increase:
This is really bad. This suggests that updates are wiping out the workout that people are using.
For those of you that can't easily disable the "Large Send Offload Version 2 (IPv4)" (or IPv6) because the WSL adapter is hidden in the control panel, here are the steps I took to disable this setting via powershell: (full disclosure: I have zero understanding/comprehension of what this setting does... so I'm essentially pressing buttons at random)
In PowerShell:
get-netadapter
This will give you a list of network adapters on your system:
Next, run the following command to view the advanced properties of the "vEthernet (WSL)" adapter:
Get-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" | Format-Table -AutoSize
Here, you can see that this setting had a value of 1, which I speculate maps to "enabled".
Next, change the value to "Disabled":
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled
.
I applied this change and network speed in my WSL environment seemed to have improved.
Thanks, the only response that works for us since we are running WSL on Windows 11 Pro where vEthernet adapters are hidden. So I executed:
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" -IncludeHidden -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled
... and voilà.... from 0-60kb/s to fullspeed
Looks like disabling TCP Segmentation Offload inside WSL/Linux also works:
sudo apt install ethtool
sudo ethtool -K eth0 tso off
sudo ethtool -k eth0 | grep 'tcp-segmentation-offload'
Credit: https://github.com/microsoft/WSL/issues/4901#issuecomment-1580750148
That fixed my upload speed being really slow.
This is getting silly, I've had to "fix" this countless times now. Which is only possible due to this thread. So I had to modify the above instructions by @peterfelts and @davorpa as there seems to have been a new change. The adapter is now hidden from get-netadapter
, and might have a different name.
I've made the assumption that the adapter will start with vEthernet and have WSL somewhere else following in the name. With that in mind here is a combined query to get the properties to check your setup
get-netadapter -IncludeHidden | Where-Object Name -like "vEthernetWSL" | Get-NetAdapterAdvancedProperty -IncludeHidden | Format-Table -Autosize That would list the advanced properties of your vEthernet WSL adapter.
To check only for LSOv2, you can run just the below
get-netadapter -IncludeHidden | Where-Object Name -like "vEthernetWSL" | Get-NetAdapterAdvancedProperty -IncludeHidden | Where-Object DisplayName -like "Large Send Offload Version 2*"
Now to disable tjhe properties for both ipv4 and ipv6
get-netadapter -IncludeHidden | Where-Object Name -like "vEthernetWSL" | Get-NetAdapterAdvancedProperty -IncludeHidden | Where-Object DisplayName -like "Large Send Offload Version 2*" | Set-NetAdapterAdvancedProperty -DisplayValue Disabled
Had to include "| Format-Table -AutoSize" to get the full adapter name:
get-netadapter -IncludeHidden | Format-Table -AutoSize | Where-Object Name -like "vEthernet (WSL (Hyper-V firewall))" | Get-NetAdapterAdvancedProperty -IncludeHidden | Where-Object DisplayName -like "Large Send Offload Version 2*" | Set-NetAdapterAdvancedProperty -DisplayValue Disabled
Had to include "| Format-Table -AutoSize" to get the full adapter name:
get-netadapter -IncludeHidden | Format-Table -AutoSize | Where-Object Name -like "vEthernet (WSL (Hyper-V firewall))" | Get-NetAdapterAdvancedProperty -IncludeHidden | Where-Object DisplayName -like "Large Send Offload Version 2*" | Set-NetAdapterAdvancedProperty -DisplayValue Disabled
I had to replace Set-NetAdapterAdvancedProperty -DisplayValue Disabled
with ForEach-Object { Set-NetAdapterAdvancedProperty -InputObject $_ -DisplayValue Disabled }
making it: Get-NetAdapter -IncludeHidden | Where-Object Name -like "vEthernet (WSL (Hyper-V firewall))" | Get-NetAdapterAdvancedProperty -IncludeHidden | Where-Object DisplayName -like "Large Send Offload Version 2*" | ForEach-Object { Set-NetAdapterAdvancedProperty -InputObject $_ -DisplayValue Disabled }
, otherwise I would get the following error six times in row: "Set-NetAdapterAdvancedProperty: The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input."
I refactored that a bit to be more verbose
# Get all network adapters, including hidden ones
Write-Host "Retrieving all network adapters, including hidden ones..."
$adapters = Get-NetAdapter -IncludeHidden
# Filter the adapters to find the one with a specific name pattern
Write-Host "Filtering for network adapter with name like 'vEthernet (WSL (Hyper-V firewall))'..."
$targetAdapter = $adapters | Where-Object Name -like "vEthernet (WSL (Hyper-V firewall))"
# Check if the target adapter is found
if ($targetAdapter) {
Write-Host "Network adapter found. Retrieving advanced properties..."
# For the found adapter, retrieve its advanced properties, including hidden ones
$advancedProperties = $targetAdapter | Get-NetAdapterAdvancedProperty -IncludeHidden
# From these properties, filter to find those with a display name matching a specific pattern
Write-Host "Filtering for properties with display name like 'Large Send Offload Version 2*'..."
$targetProperties = $advancedProperties | Where-Object DisplayName -like "Large Send Offload Version 2*"
# Check if the target properties are found
if ($targetProperties) {
Write-Host "Properties found. Disabling 'Large Send Offload Version 2'..."
# For each property that matches the criteria, set its value to 'Disabled'
foreach ($property in $targetProperties) {
Set-NetAdapterAdvancedProperty -InputObject $property -DisplayValue Disabled
Write-Host "Property '$($property.DisplayName)' is now disabled."
}
} else {
Write-Host "No properties matching the criteria were found."
}
} else {
Write-Host "No network adapter matching the criteria was found."
}
This should be answer: https://github.com/microsoft/WSL/issues/4901#issuecomment-1845315463
This should be answer: #4901 (comment)
I'm sorry, but networkingmode=mirrored only breaks my networking completely, and I already have all the other features advertised on it working
I solved the problem by trying the following (Windows 11 Home).
Disable-NetAdapterLso -IncludeHidden -Name "vEthernet (WSL)"
Hi,
this command solves the problem for me. Unfortunately, I have to rerun the command after every reboot. Is there any way to make this change permanent?
Thanks and regards
None of these get me going consistently over 200mbps with speedtest-cli in the bare wsl, or over 30mbps in docker containers. Network mode=mirrored results only in no networking working, as far as I can tell.
For those of you that can't easily disable the "Large Send Offload Version 2 (IPv4)" (or IPv6) because the WSL adapter is hidden in the control panel, here are the steps I took to disable this setting via powershell: (full disclosure: I have zero understanding/comprehension of what this setting does... so I'm essentially pressing buttons at random)
In PowerShell:
get-netadapter
This will give you a list of network adapters on your system:
Next, run the following command to view the advanced properties of the "vEthernet (WSL)" adapter:
Get-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" | Format-Table -AutoSize
Here, you can see that this setting had a value of 1, which I speculate maps to "enabled".
Next, change the value to "Disabled":
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL)" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled
.
I applied this change and network speed in my WSL environment seemed to have improved.
This worked for me... I had to change some of the values though. Here's the full:
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL (Hyper-V firewall))" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled -IncludeHidden
from
to
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL (Hyper-V firewall))" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled -IncludeHidden
This one got me from around 150-200mbps down to 350mbps down, and i'm now hitting my upload cap at close to 50mbps in bare WSL, still poking in docker at about 30mbps down, 1.5mbps up
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL (Hyper-V firewall))" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled -IncludeHidden
This one got me from around 150-200mbps down to 350mbps down, and i'm now hitting my upload cap at close to 50mbps in bare WSL, still poking in docker at about 30mbps down, 1.5mbps up
try this once
Restart-NetAdapter -Name "vEthernet (WSL (Hyper-V firewall))" -IncludeHidden
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL (Hyper-V firewall))" -DisplayName "Large Send Offload Version 2 (IPv4)" -DisplayValue Disabled -IncludeHidden
Set-NetAdapterAdvancedProperty -Name "vEthernet (WSL (Hyper-V firewall))" -DisplayName "Large Send Offload Version 2 (IPv6)" -DisplayValue Disabled -IncludeHidden
sudo apt install ethtool
sudo ethtool -K eth0 tso off
sudo ethtool -k eth0 | grep 'tcp-segmentation-offload'
What I have experienced is when I create new WSL2 instance then everything is fine. Download/Upload speeds are normal.
When I move this another drive, then the network speed becomes slow, while upload speed is same but download speed becomes very slow from 200mbps to 2-8mbps.
Looks like disabling TCP Segmentation Offload inside WSL/Linux also works:
sudo apt install ethtool sudo ethtool -K eth0 tso off sudo ethtool -k eth0 | grep 'tcp-segmentation-offload'
Credit: #4901 (comment)
That fixed my upload speed being really slow.
Thank you!!!! A thousand times thank you!! My download speed was OK (600 MBits/s) but my upload was like 1 MBit/s now it it also around 600, thank you again!!
I have tried so many things by now. The one that fixed it for me was:
Admin PowerShell:
wsl --shutdown
Disable-NetAdapterLso -IncludeHidden -Name "vEthernet *"
Version
Microsoft Windows [Version 10.0.22000.556]
WSL Version
Kernel Version
5.10.60.1
Distro Version
Ubuntu 20.04
Repro Steps
Downloading this from windows is almost instant.
Speedtest in my windows environment:
Speedtest in my WSL environment
Expected Behavior
I would expect it to not be much slower than my host machine.
Actual Behavior
~4 hours for 14mb makes it quite unusable...
Diagnostic Logs
Let me know if I should include the networking diagnostic from windows as well, they are long, so I did not add it.
WSL Networking Summary: