quarkus: Cannot access web app running on WSL from a Windows-hosted client (browser)
Describe the bug
Open a WSL terminal on Windows.
Create a sample app using the quickstart/archetypes.
Run mvn quarkus:dev
.
Try to access the app.
Expected behavior
Be able to see the expected output of the quickstart.
Actual behavior
404
How to Reproduce?
As described.
Output of uname -a
or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (27 by maintainers)
Commits related to this issue
- Make Quarkus listen on all interfaces in WSL dev mode Fixes: #22887 — committed to geoand/quarkus by geoand 2 years ago
- Merge pull request #22956 from geoand/#22887 Make Quarkus listen on all interfaces in WSL dev mode — committed to quarkusio/quarkus by geoand 2 years ago
- Make Quarkus listen on all interfaces in WSL dev mode Fixes: #22887 (cherry picked from commit bbf947be8b754ed2faacf00e654eb219a7c8e8a6) — committed to gsmet/quarkus by geoand 2 years ago
PR approved, fresh Quarkus build on Windows machine took ages 😕
Or like I have posted 2 days ago: https://github.com/quarkusio/quarkus/issues/22887#issuecomment-1013920452
Better build in WSL dist whenever you can.
Yeah, I think we can likely improve on that. Or maybe even try to detect if we are running in WSL (not sure that’s possible) and display a warning message if
quarkus.http.host
is set tolocalhost
?UPDATE:
It seems to be possible to detect if the process is running in WSL, see https://stackoverflow.com/a/61036356/2504224
Right, just setting property
<quarkus.http.host>0.0.0.0</quarkus.http.host>
doesn’t work, haven’t checked why.But you can either set property
<jvm.args>-Dquarkus.http.host=0.0.0.0</jvm.args>
or set<jvmArgs>-Dquarkus.http.host=0.0.0.0</jvmArgs>
in the configuration section of thequarkus-maven-plugin
.