How to Fix wsl (windows subsystem for linux) download and upload speed

H

 

How to Fix Network Speed Issue in WSL2

If you’ve been experiencing network speed issues in Windows Subsystem for Linux 2 (WSL2), you’re not alone. Many users have reported slower network performance compared to the host Windows machine. Fortunately, there are solutions available that can help mitigate this problem. This article will guide you through the steps to improve your WSL2 network speed.

Solution 1: Modify the WSL Configuration

To start with, you can adjust the WSL configuration to use mirrored networking mode. Follow these steps:

    1. Create a new file named .wslconfig in the directory C:\Users\YOURUSER\.
    2. Add the following content to the .wslconfig file:
[wsl2]

[experimental]
networkingMode=mirrored
    1. Save the file.
    2. Open your terminal and run the command:
wsl --shutdown
  1. Restart your WSL distro.

Once restarted, your WSL distro should now have the same network speed as your Windows host. For more details, you can refer to the official documentation here.

Solution 2: Enable IPv4 Forwarding

Another solution involves enabling IPv4 forwarding on your network interface. Here’s how to do it:

    1. Open Command Prompt (CMD) with administrative privileges.
    2. Run the following command:
netsh int ipv4 set interface "Wi-Fi" forwarding=enable

This command enables IPv4 forwarding on your Wi-Fi interface, which can help improve network performance for WSL2.

Conclusion

By following these solutions, you should notice a significant improvement in your WSL2 network speed. If you have any further questions or run into issues, consider checking the discussions on GitHub or the official WSL documentation for more information.

About the author