Skip to content

Commit

Permalink
Updated decontainer config to support WSLg.
Browse files Browse the repository at this point in the history
  • Loading branch information
harmen-xb committed Nov 16, 2023
1 parent 10339fa commit 2801853
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,42 @@
"eamodio.gitlens",
"davidanson.vscode-markdownlint",
"ms-playwright.playwright",
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"orta.vscode-jest"
]
}
},
// Allow port 3000 to be forwarded.
"forwardPorts": [3000],
"portsAttributes": {
"3000": {
"label": "Theia Backend",
"onAutoForward": "openBrowserOnce"
"label": "Theia Backend" //,
// "onAutoForward": "openBrowserOnce"
}
},
// Install the playwright dependencies.
"postCreateCommand": "yarn playwright install --with-deps",
// PlayWright with headed Chromium doesn't seem to work yet wih the current config.
// There are some articales about it being possible:
// PlayWright with headed Chromium seems to work yet wih the current config for mounts and containerEnv.
// There are some articles about it being possible:
// - https://playwright.dev/docs/docker
// - https://stackoverflow.com/questions/73092750/how-to-show-gui-apps-from-docker-desktop-container-on-windows-11
// - https://github.com/microsoft/wslg/issues/782
// The config below is the current preparation based on the articles above.
"containerEnv": { "DISPLAY": ":0" },
"mounts": [
{
"source": "/run/desktop/mnt/host/wslg/.X11-unix",
"target": "/tmp/.X11-unix",
"type": "bind"
},
{
"source": "/run/desktop/mnt/host/wslg",
"target": "/mnt/wslg",
"type": "bind"
}
]
],
"containerEnv": {
"DISPLAY": ":0",
"WAYLAND_DISPLAY": "wayland-0",
"XDG_RUNTIME_DIR": "/mnt/wslg/runtime-dir",
"PULSE_SERVER": "/mnt/wslg/PulseServer"
}
}

0 comments on commit 2801853

Please sign in to comment.