Skip to content
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

Make WSL2 - Host ports access seamless #10

Open
vishnuprasadc opened this issue Nov 20, 2020 · 2 comments
Open

Make WSL2 - Host ports access seamless #10

vishnuprasadc opened this issue Nov 20, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@vishnuprasadc
Copy link

Summary

For several back-end stack/services, Java developers rely on launching local docker images. With WSL 2, accessing the open ports / running services on Windows host has become tedious.

Motivation

With WSL 1, when a running docker image exposes ports on Windows host, access via shell was seamless. With WSL 2, this requires explicit configurations. May be the need for tightening access controls took precedence here (probably due to WSL 2 architecture changes), but some simplification about accessing host ports from WSL 2 shells could be very useful in simplifying the development experience.

@vishnuprasadc vishnuprasadc added the enhancement New feature or request label Nov 20, 2020
@vishnuprasadc vishnuprasadc changed the title Make WSL2 Ports Exposure Seamless Make WSL2 - Host ports access seamless Nov 20, 2020
@brunoborges
Copy link
Member

brunoborges commented Nov 30, 2020

@vishnuprasadc have you tried updating Windows?

According to the documentation, this should work out of the box.

https://docs.microsoft.com/en-us/windows/wsl/compare-versions#accessing-network-applications

https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers

@bitcrazed
Copy link

@vishnuprasadc What build of Windows 10 are you running, and which distro? And which version of Docker?

Scenario?

Could I ask you to share a little more of what you're trying to achieve? What you're running, and where? For example, are you running a Java service hosted within a WSL instance, or within a Docker container running in WSL that you'd like to access from the Windows host?

Background

WSL1 exposes a POSIX compatible layer atop the NT kernel, upon which it runs distros and Linux binaries. because Linux and Windows share the same kernel, and thus networking stack, they were also able to access one anothers' ports etc.

WSL2 runs distros and Linux binaries in containers (one per distro) atop a real Linux kernel, all running in a lightweight VM. As such, WSL2 doesn't share/use any of NT's kernel infrastructure, and so WSL2 has to perform some non-trivial network traffic routing, etc. to marshal traffic between the Windows host and the WSL2 worker VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants