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

Most upvoted comments

PR approved, fresh Quarkus build on Windows machine took ages 😕

fresh Quarkus build on Windows machine took ages 😕

Better build in WSL dist whenever you can.

Or can we improve something on the documentation side of things?

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 to localhost?

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 the quarkus-maven-plugin.