-
Notifications
You must be signed in to change notification settings - Fork 288
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
Enable a browser to be used within the dev container. #3540
Comments
Hmmm - interesting question. Unclear how we could make that work. We do not want to mount the browser since this would not work in when the host is remote, and conceivably the URI needs to be forwarded if it was pointing to localhost. In some cases, you may actually want xdg-open to open a browser in a container as well (like in the case of https://github.com/microsoft/vscode). |
Do you mean headless chrome? |
I don't think I mean a headless browser. All I do know is it would be nice if in the vs code remote container, you could use your browser as you would normally. examples: executing executing |
You can't use your browser from inside the container and will never be able to do it. Docker container has no access to the host's drivers or GPU for common purposes. The docker container is always headless - it communicates with the outside world via tty or TCP/UDP ports. |
@seanybaggins What is written exactly about runtime resource allocation by Docker container, please, read Runtime resource allocation. To see the web page on the screen the following virtual resources are required: display memory, HDMI or USB3 cables, display panel. Since the browser uses TCP for communication and builds DOM before pixel rendering, Headless Chrome does everything except pixel rendering. |
The solution implemented by xdg-open-server seems simple and elegant: I suspect something like that already exists internally (whatever mechanism handles github logins for example), it just needs to be exposed on the command line inside the container. Something like |
Currently running into this as well! Trying to get credentials using DUO OIDC provider which requires opening a browser window as well. A simple |
Trying https://github.com/devcontainers/features/tree/main/src/desktop-lite#example-usage to see if this solves our use case for now. |
After setting up the BROWSER=/vscode/vscode-server/bin/linux-arm64/d045a5eda657f4d7b676dedbfa7aab8207f8a075/bin/helpers/browser.sh Installing Which then actually opens the browser window on the host machine! No need for the |
My solution in a C# (.NET) devcontainer:
in postCreateCommand.sh
|
Continuing in devcontainers/images#885. |
It would be nice if I am working on a rust project if I could open the generated documentation using
cargo doc --open
. Instead I get the following warningIt would be nice if this functionality existed without needing to explicitly mount the browser on the host to the container and setting
BROWSER
environment variable within the Dockerfile.The text was updated successfully, but these errors were encountered: