WSL 2 how to use the host's network proxy

ICASH 20 Reputation points
2025-02-20T17:34:24.6433333+00:00

我在WSL中部署docker之后,出现了拉取镜像超时的问题,好像是网络问题,我应该怎么配置让我的WSL直接使用我的主机网络

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2025-02-21T01:42:36.7633333+00:00

    Hi,

    WSL uses a NAT by default. You can try setting networkingMode=mirrored under [wsl2] in the .wslconfig file to enable mirrored mode networking.

    Enabling this changes WSL to an entirely new networking architecture which has the goal of 'mirroring' the network interfaces that you have on Windows into Linux.

    https://learn.microsoft.com/zh-cn/windows/wsl/networking#mirrored-mode-networking

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.