Skip to content

Devcontainer setting remote.localPortHost=allInterfaces is not respected (2025) #11131

@codeBehindMe

Description

@codeBehindMe

Existing issue (closed) : #6445

  • VSCode Version:
    Version: 1.102.3 (user setup)
    Commit: 488a1f239235055e34e673291fb8d8c810886f81
    Date: 2025-07-29T03:00:23.339Z
    Electron: 35.6.0
    ElectronBuildId: 11847422
    Chromium: 134.0.6998.205
    Node.js: 22.15.1
    V8: 13.4.114.21-electron.0
    OS: Windows_NT x64 10.0.26200

Insiders:
Version: 1.103.0-insider (user setup)
Commit: 34769c5d17df269aed44407eb1a1c0e6362e2d79
Date: 2025-08-04T21:43:35.566Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Windows_NT x64 10.0.26200

  • Local OS Version: Windows 11 HOME 25H2
  • Remote OS Version: Debian GNU/Linux 12 (bookworm)
  • Remote Extension/Connection Type: Dev Containers/WSL/Remote - Dev Containers

Steps to Reproduce:

  1. Open VSCode with the Remote - Containers extension installed.
  2. Select Remote-Containers: Try a Development Container Sample from the command palette.
  3. Choose Python
  4. Wait for VSCode to switch, load, and build
  5. Set Remote: Local Port Host setting to the allInterfaces option in all 3, workspace, user and remote settings. Reload window if necessary
  6. Create a simple python fast api server
pip install fastapi[standard]
# main.py
from fastapi import FastAPI
import os

app = FastAPI()


@app.get("/")
async def root():
    return {"message": "Hello World"}

if __name__ == "__main__":
    app.run(debug=False, host="0.0.0.0", port=int(os.environ.get("PORT", 8080)))
uvicorn main:app --host 0.0.0.0
  1. confirm that port is forwarded, incorrectly on localhost:8080
  2. confirm access through browser on the host
Image
  1. confirm no access through curl command on host
Image

Expected behaviour:

The forwarded port should be on 0.0.0.0:8080

Observed behaviour

The forwarded port is on localhost:8080

Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A

Metadata

Metadata

Assignees

Labels

containersIssue in vscode-remote containers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions