Code Monkey home page Code Monkey logo

Comments (21)

wangyw6716 avatar wangyw6716 commented on September 25, 2024 7

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

from wsl.

wangyw6716 avatar wangyw6716 commented on September 25, 2024 4

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Ohhh!!!

It is working now. Thank you very much.

image

I tried disabling every service until I reached network-manager.service, and finally, the mirrored functionality started working properly. It took me a significant amount of time to figure this out.

from wsl.

github-actions avatar github-actions commented on September 25, 2024 2

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

from wsl.

GitUser200607 avatar GitUser200607 commented on September 25, 2024 1

I did not changed anything and a couple of weeks ago all worked well.

from wsl.

msojocs avatar msojocs commented on September 25, 2024

Afte view this issue (#10632), I have checked the port binding in wsl:

Can wsl use the port same with windows?

  1. execute python -m http.server --bind 0.0.0.0 with windows, success
  2. execute python3 -m http.server --bind 0.0.0.0 with wsl, failed.

image

Can windows access web started by wsl?

When I use edge in windows, I can access the web by 192.168.0.102, but 127.0.0.1 is not worked.

image

image

from wsl.

pmartincic avatar pmartincic commented on September 25, 2024

What do you get from netstat -an | findstr /c:"7890" | findstr /c:"LISTENING"?

from wsl.

msojocs avatar msojocs commented on September 25, 2024

What do you get from netstat -an | findstr /c:"7890" | findstr /c:"LISTENING"?

This is the result.

image

from wsl.

pffang avatar pffang commented on September 25, 2024

Similar issue.
If I kill all WSL processes and restart it, I can access Windows localhost:port again.
But if I leave it running for hours, I cannot access Windows localhost:port from WSL.

from wsl.

msojocs avatar msojocs commented on September 25, 2024

Similar issue. If I kill all WSL processes and restart it, I can access Windows localhost:port again. But if I leave it running for hours, I cannot access Windows localhost:port from WSL.

This method does not work for me.

from wsl.

GitUser200607 avatar GitUser200607 commented on September 25, 2024

Similar issue.
If I kill all WSL processes and restart it, I can access Windows localhost:port again.
But if I leave it running for hours, I cannot access Windows localhost:port from WSL.

Did not work for me too.

from wsl.

keith-horton avatar keith-horton commented on September 25, 2024

If you want to connect to the host from the WSL container by the IP address assigned you'll need to connect to 127.0.01. If you want to connect to the assigned address, you need to set [experimental] hostAddressLoopback=true (see https://learn.microsoft.com/en-us/windows/wsl/wsl-config#experimental-configuration-settings).

But in the original repro, it was sent to 127.0.0.1, so that's valid.
We see a RST immediately returned.

15:44:12.145100 IP 127.0.0.1.60816 > 127.0.0.1.7890: Flags [S], seq 2455237139, win 65495, options [mss 65495,sackOK,TS val 260823200 ecr 0,nop,wscale 7], length 0
15:44:12.145107 IP 127.0.0.1.7890 > 127.0.0.1.60816: Flags [R.], seq 0, ack 2455237140, win 0, length 0

Everything else looks setup correctly (Hyper-V Firewall is setup correctly).
This suggests one of 2 things that I can see:

  1. the app wasn't bound & listening to that port at the time
  2. Cisco's VMWare solution has filters that are causing issues
    (I only bring up VMWare as we have observed many interop issues in the past).

from wsl.

msojocs avatar msojocs commented on September 25, 2024

If you want to connect to the host from the WSL container by the IP address assigned you'll need to connect to 127.0.01. If you want to connect to the assigned address, you need to set [experimental] hostAddressLoopback=true (see https://learn.microsoft.com/en-us/windows/wsl/wsl-config#experimental-configuration-settings).

But in the original repro, it was sent to 127.0.0.1, so that's valid. We see a RST immediately returned.

15:44:12.145100 IP 127.0.0.1.60816 > 127.0.0.1.7890: Flags [S], seq 2455237139, win 65495, options [mss 65495,sackOK,TS val 260823200 ecr 0,nop,wscale 7], length 0 15:44:12.145107 IP 127.0.0.1.7890 > 127.0.0.1.60816: Flags [R.], seq 0, ack 2455237140, win 0, length 0

Everything else looks setup correctly (Hyper-V Firewall is setup correctly). This suggests one of 2 things that I can see:

  1. the app wasn't bound & listening to that port at the time
  2. Cisco's VMWare solution has filters that are causing issues
    (I only bring up VMWare as we have observed many interop issues in the past).

I have uninstalled the VMWare just now and reboot the computer, but it still not work.

I think the app was bound the port at the time, because I can not access google without this proxy (google was blocked in my country).

And now I can access google(port is work in host), but telnet 127.0.0.1 7890 still can not work with wsl.

from wsl.

pffang avatar pffang commented on September 25, 2024

If you want to connect to the host from the WSL container by the IP address assigned you'll need to connect to 127.0.01. If you want to connect to the assigned address, you need to set [experimental] hostAddressLoopback=true (see https://learn.microsoft.com/en-us/windows/wsl/wsl-config#experimental-configuration-settings).

But in the original repro, it was sent to 127.0.0.1, so that's valid. We see a RST immediately returned.

15:44:12.145100 IP 127.0.0.1.60816 > 127.0.0.1.7890: Flags [S], seq 2455237139, win 65495, options [mss 65495,sackOK,TS val 260823200 ecr 0,nop,wscale 7], length 0 15:44:12.145107 IP 127.0.0.1.7890 > 127.0.0.1.60816: Flags [R.], seq 0, ack 2455237140, win 0, length 0

Everything else looks setup correctly (Hyper-V Firewall is setup correctly). This suggests one of 2 things that I can see:

1. the app wasn't bound & listening to that port at the time

2. Cisco's VMWare solution has filters that are causing issues
   (I only bring up VMWare as we have observed many interop issues in the past).

But I used mirrored mode and no VMWare.

from wsl.

msojocs avatar msojocs commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Ohhh!!!

It is working now. Thank you very much.

image

from wsl.

msojocs avatar msojocs commented on September 25, 2024

solved.

Answer:

#11312 (comment)

from wsl.

yunus-sun avatar yunus-sun commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Similar issue. It works for me. Thanks so much!

from wsl.

qgyhd1234 avatar qgyhd1234 commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Solved my problem, thanks

from wsl.

Kutius avatar Kutius commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Failed to disable unit: Unit file network-manager.service does not exist.😢

from wsl.

gsxgoldenlegendary avatar gsxgoldenlegendary commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Failed to disable unit: Unit file network-manager.service does not exist.😢

The NetworkManager service has been named NetworkManager. You can see https://askubuntu.com/questions/1371275/where-has-the-network-manager-service-in-21-10-gone for details.

from wsl.

Kutius avatar Kutius commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Failed to disable unit: Unit file network-manager.service does not exist.😢

The NetworkManager service has been named NetworkManager. You can see https://askubuntu.com/questions/1371275/where-has-the-network-manager-service-in-21-10-gone for details.

Unlucky😢😢, it also show: Failed to disable unit: Unit file NetworkManager.service does not exist.

from wsl.

Clark-G avatar Clark-G commented on September 25, 2024

Try executing the command

sudo systemctl disable network-manager.service

followed by running wsl.exe --shutdown in PowerShell, and then restart WSL again.

Failed to disable unit: Unit file network-manager.service does not exist.😢

The NetworkManager service has been named NetworkManager. You can see https://askubuntu.com/questions/1371275/where-has-the-network-manager-service-in-21-10-gone for details.

Unlucky😢😢, it also show: Failed to disable unit: Unit file NetworkManager.service does not exist.

same issue here

from wsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.