containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.45k stars 2.31k forks source link

Port conflict of WSL2 with CRC for SSH (usermode networking) #20327

Open gbraad opened 9 months ago

gbraad commented 9 months ago

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

https://github.com/crc-org/crc/issues/3855

gbraad commented 9 months ago

@n1hility We should both be checking if the port is already in use and suggest an alternative. Though, we might wanna solve this in gvproxy... as multiple instances of a WLS2 machine might run into the same issue.

https://github.com/containers/gvisor-tap-vsock/blob/2a3419da952638147a42db9d49bd74bd10d2340c/pkg/types/gvproxy_command.go#L35

There is re-assignment code, but this might be used more generically: https://github.com/containers/podman/commit/63a8926e96203cf0070e0b0cb14e79815942f0a0

github-actions[bot] commented 8 months ago

A friendly reminder that this issue had no activity for 30 days.

rhatdan commented 8 months ago

@gbraad @n1hility any movement on this one?

n1hility commented 8 months ago

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.

github-actions[bot] commented 7 months ago

A friendly reminder that this issue had no activity for 30 days.

Luap99 commented 3 months ago

@n1hility Was this fixed with the port re-assign logic in machine?