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

[desktop-lite] Only works with vscode #1039

Closed
daniel-meilak opened this issue Jul 14, 2024 · 4 comments
Closed

[desktop-lite] Only works with vscode #1039

daniel-meilak opened this issue Jul 14, 2024 · 4 comments

Comments

@daniel-meilak
Copy link
Contributor

daniel-meilak commented Jul 14, 2024

I have been trying to make use of the devcontainer-cli without using vscode. I am on wsl2 and have used the following .devcontainer/devcontainer.json for setting up a container with desktop-lite:

{
    "image": "mcr.microsoft.com/devcontainers/base:focal",
    "features": {
        "ghcr.io/devcontainers/features/desktop-lite": {
            "password": "vscode",
            "webPort": "6080"
        }
    },
    "forwardPorts": [
        6080
    ],
    "portsAttributes": {
        "6080": {
            "label": "Web VNC"
        }
    }
}

When running the dev container using vscode, I am able to open the ports tab & use the novnc server on localhost:6080, however when I try to run the same dev container using only the cli, the novnc page fails to load.

On wsl, these are the steps I follow:

> devcontainer up --workspace-folder .
[...]
> devcontainer exec --workspace-folder . -- /bin/bash

After which I attempt to open localhost:6080 on a browser in windows, which does not work.

I am assuming that it is possible to get this to work using only the cli. Is there some additional setup which vscode does automatically?

@daniel-meilak
Copy link
Contributor Author

A colleague of mine pointed me towards this issue, which points out that forwardPorts does not have the desired effect when using only the devcontainer-cli. The workaround is to use appPort instead which works perfectly.

Before closing the issue, could I suggest adding this information to the desktop-lite README.md?

@bamurtaugh
Copy link
Member

Thank you for the issue and for sharing the workaround here.

If you have a moment, would you be interested in opening a PR to add the info to the desktop-lite README? I think that's a fantastic idea, and if you cc me in the PR, I'd be happy to review and merge.

@daniel-meilak
Copy link
Contributor Author

Hey @bamurtaugh, I've created a small PR to add the documentation. Let me know if I should change anything. I've also mentioned you in the PR

@bamurtaugh
Copy link
Member

bamurtaugh commented Aug 12, 2024

LGTM, thanks so much! Going to close this as completed.

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

No branches or pull requests

2 participants