-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port conflict of WSL2 with CRC for SSH (usermode networking) #20327
Comments
A friendly reminder that this issue had no activity for 30 days. |
I think I should fix this / work around on the wsl side. We can pick an unused port. It’s not actually used in this particular use case. |
A friendly reminder that this issue had no activity for 30 days. |
@n1hility Was this fixed with the port re-assign logic in machine? |
The generic vmconfigs code in podman 5 seems to always allocate a random port and to never use 2222 : podman/pkg/machine/vmconfigs/machine.go Lines 85 to 95 in bb6b2e9
|
I just installed podman-desktop/podman-machine on a fresh Windows install and |
Did you use user-mode-networking ? |
The checkbox in podman-desktop was checked, and gvproxy was listed in the task manager. |
I just started my machine with user mode networking and tcpview64 gives this for gvproxy: And
|
For podman machine doesn't it always user mode networking (because depend on gvproxy) ? |
On MacOS yes on Windows WSL the default is not to enable user mode networking |
What happens is that on wsl2, podman-machine starts gvproxy with This means on wsl2 gvproxy will always bind to port 2222 even though podman-machine does not need this. If wsl2 did something like this podman/pkg/machine/shim/networking.go Line 62 in 1ae4b04
I could not understand where in the wsl2 code gvproxy is started, so no patch suggestion :( |
Maybe cfergeau@1a950bc but I have no idea how to make a windows podman build in order to test it. EDIT: I've managed to build and test it with |
podman-machine starts gvproxy without specifying -ssh-port. This means it will always bind port 2222 (see containers/gvisor-tap-vsock#402), effectively bypassing the dynamic ssh port allocation. I don't think wsl needs this port to be opened/bound on the host, but this commit starts gvproxy with -ssh-port set to the dynamic SSH port to avoid port conflicts with crc. When gvproxy allows to disable this port forwarding entirely, we can revise this. This should fix containers#20327 Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Now that containers/gvisor-tap-vsock#402 is merged in gvisor-tap-vsock, we need a gvisor-tap-vsock release, and then #24070 can be updated to make use of it. |
/assign |
Issue Description
With the recent introduction of usermode networking, the network stack of podman machine on Windows uses port 2222 to forward ssh. This can conflict with the default of CRC which will ALWAYS use usermode networking and the 2222 port forward for ssh.
Steps to reproduce the issue
n/a
Describe the results you received
Unable to start either depending who comes first
Describe the results you expected
We should both be checking if the port is already in use and suggest an alternative.
podman info output
n/a
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Windows with Podman machine on WSL2 and CRC
Additional information
Usermode networking
crc-org/crc#3855
The text was updated successfully, but these errors were encountered: