devpod icon indicating copy to clipboard operation
devpod copied to clipboard

port forwarding failing - No forwarded ports

Open IntranetFactory opened this issue 5 months ago • 3 comments

I have the following devcontainer.json to run Playwright tests and to inspect the web browser with devcontainer VNC Desktop Lite:

{
  "name": "Playwright Testing",
  "image": "mcr.microsoft.com/playwright:jammy",
  "forwardPorts": [
    9323,
    6080
  ],
  "portsAttributes": {
    "6080": {
      "label": "desktop"
    }
  },
  "features": {
    "ghcr.io/devcontainers/features/desktop-lite:1": {}
  },
  "postCreateCommand": "npm install && npx playwright install",
  "customizations": {
    "vscode": {
      "extensions": [
        "ms-playwright.playwright"
      ]
    }
  }
}

When I open that repo with GitHub Codespace I see the expected VNC port 6080

image

When I open with DevPod in a workspace with VS Code on Windows 11 I see no ports:

image

Should I see port 6080 also when using DevPod ?

IntranetFactory avatar Mar 11 '24 12:03 IntranetFactory

Hi @IntranetFactory, even though you're not seeing the port it should still forward it. Could you confirm that's not the case?

pascalbreuninger avatar Mar 11 '24 13:03 pascalbreuninger

I'm sorry, I didn't check that - you are right http://127.0.0.1:6080/ opens the noVNC viewer. So is it expected that the PORTS tab remains empty?

IntranetFactory avatar Mar 11 '24 14:03 IntranetFactory

At least it works, that's something :) For me it shows up sometimes and sometimes it doesn't, haven't figured out how to advertise the ports consistently to VSCode. Maybe this issue is a nice opportunity to dig into it

pascalbreuninger avatar Mar 11 '24 15:03 pascalbreuninger