-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Cannot access web app running on WSL from a Windows-hosted client (browser) #22887
Comments
Thanks for reporting. @rsvoboda do you have a Windows machine so you can verify this? |
I have Windows VM, but it's without nested virtualization so I can't really check WSL 2 now. I will ask my wife to borrow me her Windows laptop when she gets home ;) |
Thanks! |
Good news, I have managed to boot into Boot Camp based Windows with enabled Virtualization thanks to the trick mentioned in https://superuser.com/questions/717421/how-to-enable-hardware-virtualization-on-a-macbook In WSL 2 I was able to run Quarkus sample app from code.quarkus in dev mode. Application is not accessible from Windows-hosted browser because the default host is localhost / 127.0.0.1 and wsl acts as fast VM. Running Maven command with |
The other issue seems to be about running "natively" on Windows, not in WSL2. |
@famod have you tried with this setting as a Maven property in the Pom? |
@brunoborges we have it in But you should be able to set it via Maven, too. |
I think I tried to set it via Maven in the pom, and did not see success. That's why I'm asking you to test as well. Granted, my project was an older Quarkus, that then I manually updated to the latest version. So maybe I missed something. |
Right, just setting property But you can either set property |
Isn't this because the Maven plugin is not passing along Maven properties to Quarkus as system properties? This sounds like a quite useful enhancement. |
Quarkus does read properties from Maven, however it only applies them to build time configuration, i.e. configuration that cannot change at runtime - which is not the case for |
Ah, right! ⬆️ 👍 So it seems we should close this issue. |
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 UPDATE: It seems to be possible to detect if the process is running in WSL, see https://stackoverflow.com/a/61036356/2504224 |
Not sure if a warning is too invasive. Nobody stops you from running a desktop in WSL, with a browser. But logging is actually better than extending the docs, RTFM you know. 😉 |
Isn't it better if you just go with the expected behavior of the developer? If the setting is in the pom, use it. If it is inside WSL, deploy to 0.0.0.0 by default. Document the default behavior. |
IIRC, a long time ago there was a change to not bind to 0.0.0.0 because of security reasons? |
Yeah, this is only for WSL |
ok, booting to windows |
PR approved, fresh Quarkus build on Windows machine took ages :/ |
Thanks! |
Better build in WSL dist whenever you can. |
Make Quarkus listen on all interfaces in WSL dev mode
I had my Windows machine with almost nothing in |
Any tip on how to configure |
Something like: <plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<systemProperties>
<quarkus.http.host>0.0.0.0</quarkus.http.host>
</systemProperties>
</configuration>
</plugin> should work, although I haven't tried it. If that does not work, let me know and I'll try it out tomorrow |
Or like I have posted 2 days ago: #22887 (comment) |
Fixes: quarkusio#22887 (cherry picked from commit bbf947b)
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
orver
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
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: