From ce3f93793d16d4e53a49bb402b80c46c4956efe7 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 21:52:03 -0800 Subject: [PATCH 01/11] Document the Windows Devcontainer Launch That Sets Both HOME and USERPROFILE The snippets' bind mounts join ${localEnv:HOME}${localEnv:USERPROFILE}. A Windows launch with both set gives an invalid path, and the container fails to start. The substitution has no fallback syntax, so devcontainer.json cannot choose one of them. The maintainer chose to document the limit rather than move the snippets to Compose. The docs also disagreed: one said the mounts only work from POSIX hosts, and another said the fallback handled Windows. Each now states what a real start measured on a Windows host. --- docs/devcontainer.md | 5 +++++ docs/host-setup.md | 3 ++- docs/ssh-signing.md | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 99c4ece14..b6a4d79cb 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -33,6 +33,8 @@ The host SSH key, allowed-signers file, and `gh` config directory are mounted in | `~/.config/git/allowed_signers` | `/home/vscode/.config/git/allowed_signers` | read-only | Maps your email to your public key so `git verify-commit` and `git log --show-signature` work inside the container. | | `~/.config/gh` | `/home/vscode/.config/gh` | read-write | `gh` CLI auth state shared with the host. See [`gh` credential store][gh-credential-store] below. | +Each mount's `source` finds the host home directory by joining `${localEnv:HOME}${localEnv:USERPROFILE}`, so exactly one of those variables must be set. See [Troubleshooting][troubleshooting] for a Windows launch that sets `HOME` too. + VS Code Dev Containers automatically copies your host `~/.gitconfig` into the container at startup. So `user.name`, `user.email`, `user.signingkey`, `gpg.format`, and `commit.gpgsign` propagate without an explicit mount. The SSH agent is forwarded automatically by the Dev Containers extension via `SSH_AUTH_SOCK`. So signing works as long as the agent on the host has your key loaded. @@ -100,6 +102,8 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig ## Troubleshooting +**Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash does this, and so does a `HOME` variable set in the Windows environment. `devcontainer.json` substitution has no fallback that picks one of them. Close every VS Code window, then reopen the repo from WSL2 or launch VS Code from the Start menu. Remove a `HOME` variable set in the Windows environment first. + **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. **`git commit` fails with "no SSH agent socket".** VS Code Dev Containers forwards `SSH_AUTH_SOCK` automatically, but only if the host has `ssh-agent` running with at least one key. Run `ssh-add -l` on the host first, and if it says "could not open a connection to your authentication agent", start the agent (see [host setup][host-setup]). @@ -116,6 +120,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig [devcontainer-2]: ../catalog/snippets/devcontainer/python/devcontainer.json [gh-credential-store]: #gh-credential-store [host-setup]: ./host-setup.md +[troubleshooting]: #troubleshooting diff --git a/docs/host-setup.md b/docs/host-setup.md index 5cfa3c7c3..08a5dec19 100644 --- a/docs/host-setup.md +++ b/docs/host-setup.md @@ -6,7 +6,7 @@ Supported hosts: - **Linux** - both the devcontainer flow and the host-install flow. - **macOS** - both the devcontainer flow and the host-install flow. -- **Windows** - the devcontainer flow requires **WSL2**, and native Windows (PowerShell + winget) is supported only for the host-install flow described in `README.md`. The bind-mounts in the `catalog/snippets/devcontainer/` definitions rely on POSIX paths and only work from Linux/macOS/WSL2. +- **Windows** - the supported devcontainer route is **WSL2**, and native Windows (PowerShell + winget) is supported for the host-install flow described in `README.md`. A native launch of a `catalog/snippets/devcontainer/` definition starts only where `USERPROFILE` is set and `HOME` is not, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. > **Shell assumptions in this doc**: every command snippet below assumes a **POSIX shell** (bash/zsh) and POSIX path conventions (`~/.ssh/...`, `mkdir -p`, `$(...)` command substitution). A block marked `powershell` is the exception. Such a block is the **Windows-native** form of the step it sits in, meant to run in PowerShell rather than translated. On Windows, run the POSIX snippets from **WSL2** or **Git Bash**, since they will not work as-is in PowerShell or `cmd.exe`. The git config and `gh` commands are portable, and only the file and path manipulation differs by shell. @@ -406,6 +406,7 @@ A host that fails any row is not ready for the procedure that row names. The fix [bootstrap]: ../host-setup/bootstrap.sh [bootstrap-ps1]: ../host-setup/bootstrap.ps1 [devcontainer]: ./devcontainer.md +[devcontainer-troubleshooting]: ./devcontainer.md#troubleshooting [files]: ../spec/files.json [governance-git-and-commit-rules]: ../GOVERNANCE.md#git-and-commit-rules [host-gate]: ../scripts/host_gate.py diff --git a/docs/ssh-signing.md b/docs/ssh-signing.md index 922f9ca9f..14c9d13f3 100644 --- a/docs/ssh-signing.md +++ b/docs/ssh-signing.md @@ -85,9 +85,9 @@ The Keychain prompt for the passphrase appears on first use after each reboot, a ### Windows (without WSL) -Native Windows is **not supported** for the devcontainer setup in this repo. Use WSL2 instead. The reason: VS Code Dev Containers needs a Linux-like file system for the bind-mounts to behave consistently. A second part of the reason is that Docker Desktop's WSL2 backend is the supported path. +WSL2 is the supported route for the devcontainer setup in this repo, since Docker Desktop's WSL2 backend is the supported path. A native Windows launch starts the container only where `USERPROFILE` is set and `HOME` is not, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. Commit signing inside a container started that way is untested. -If you must work on Windows directly without a devcontainer, OpenSSH for Windows can sign with `gpg.format=ssh`, but the bind-mounted devcontainer setup expects Linux/WSL2 paths. +If you must work on Windows directly without a devcontainer, OpenSSH for Windows can sign with `gpg.format=ssh`. ## Verify Signing @@ -116,11 +116,12 @@ If the container's `~/.ssh` directory exists with the wrong owner (root, surface **`signing failed: no allowed signers`.** The `allowed_signers` file exists but doesn't contain a line matching `user.email` + a key. Re-run `echo "$(git config --global user.email) namespaces=\"git\" $(cat ~/.ssh/id_ed25519.pub)" >> ~/.config/git/allowed_signers`. -**Verifies on the host but not in the container.** The bind-mount source path differs. `${localEnv:HOME}` resolves on Linux/macOS hosts, and on Windows hosts (WSL2 backend) the `${localEnv:USERPROFILE}` fallback in `devcontainer.json` handles it. Check the actual mount with `mount | grep ssh` inside the container. +**Verifies on the host but not in the container.** The bind-mount source path differs. Each `source` in `devcontainer.json` joins `${localEnv:HOME}${localEnv:USERPROFILE}`, which resolves where exactly one of them is set. That is `HOME` on Linux, macOS, and WSL2, and `USERPROFILE` on a native Windows launch. Check the actual mount with `mount | grep ssh` inside the container. **SSH agent says "could not open a connection".** The host's agent isn't running. Linux: `systemctl --user start ssh-agent.socket`. macOS: open a new terminal so launchd starts the agent. [devcontainer]: ./devcontainer.md +[devcontainer-troubleshooting]: ./devcontainer.md#troubleshooting [host-setup]: ./host-setup.md From ba6b85a010f47c710a38d7aeb955c00fe6be5263 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 21:56:44 -0800 Subject: [PATCH 02/11] State a Native Windows Launch's Conditions Rather Than That It Starts A local review found the first wording overclaimed. The measured start used a synthetic home holding every mount source, and a scratch image tag. On a real Windows host the gh mount source can be missing, since gh defaults to AppData there. The removal advice for a persistent HOME could also break a host's git and SSH configuration. --- docs/devcontainer.md | 6 ++++-- docs/host-setup.md | 2 +- docs/ssh-signing.md | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index b6a4d79cb..3a487e128 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -33,7 +33,7 @@ The host SSH key, allowed-signers file, and `gh` config directory are mounted in | `~/.config/git/allowed_signers` | `/home/vscode/.config/git/allowed_signers` | read-only | Maps your email to your public key so `git verify-commit` and `git log --show-signature` work inside the container. | | `~/.config/gh` | `/home/vscode/.config/gh` | read-write | `gh` CLI auth state shared with the host. See [`gh` credential store][gh-credential-store] below. | -Each mount's `source` finds the host home directory by joining `${localEnv:HOME}${localEnv:USERPROFILE}`, so exactly one of those variables must be set. See [Troubleshooting][troubleshooting] for a Windows launch that sets `HOME` too. +Each mount's `source` finds the host home directory by joining `${localEnv:HOME}${localEnv:USERPROFILE}`, so exactly one of those variables must be set. Each host path must also exist under that directory, or Docker refuses the mount. See [Troubleshooting][troubleshooting] for a native Windows launch. VS Code Dev Containers automatically copies your host `~/.gitconfig` into the container at startup. So `user.name`, `user.email`, `user.signingkey`, `gpg.format`, and `commit.gpgsign` propagate without an explicit mount. @@ -102,7 +102,9 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig ## Troubleshooting -**Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash does this, and so does a `HOME` variable set in the Windows environment. `devcontainer.json` substitution has no fallback that picks one of them. Close every VS Code window, then reopen the repo from WSL2 or launch VS Code from the Start menu. Remove a `HOME` variable set in the Windows environment first. +**Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. Launching VS Code from Git Bash passes `HOME` to it, and a `HOME` variable set in the Windows environment reaches every launch. `devcontainer.json` substitution has no fallback that picks one of them. WSL2 is the supported route, and each host path must exist under the WSL2 home. + +A native launch is outside that route and needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Commit signing inside a container started this way is untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. diff --git a/docs/host-setup.md b/docs/host-setup.md index 08a5dec19..2096d333c 100644 --- a/docs/host-setup.md +++ b/docs/host-setup.md @@ -6,7 +6,7 @@ Supported hosts: - **Linux** - both the devcontainer flow and the host-install flow. - **macOS** - both the devcontainer flow and the host-install flow. -- **Windows** - the supported devcontainer route is **WSL2**, and native Windows (PowerShell + winget) is supported for the host-install flow described in `README.md`. A native launch of a `catalog/snippets/devcontainer/` definition starts only where `USERPROFILE` is set and `HOME` is not, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. +- **Windows** - the supported devcontainer route is **WSL2**, and native Windows (PowerShell + winget) is supported for the host-install flow described in `README.md`. A native launch of a `catalog/snippets/devcontainer/` definition is outside that route and has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. > **Shell assumptions in this doc**: every command snippet below assumes a **POSIX shell** (bash/zsh) and POSIX path conventions (`~/.ssh/...`, `mkdir -p`, `$(...)` command substitution). A block marked `powershell` is the exception. Such a block is the **Windows-native** form of the step it sits in, meant to run in PowerShell rather than translated. On Windows, run the POSIX snippets from **WSL2** or **Git Bash**, since they will not work as-is in PowerShell or `cmd.exe`. The git config and `gh` commands are portable, and only the file and path manipulation differs by shell. diff --git a/docs/ssh-signing.md b/docs/ssh-signing.md index 14c9d13f3..daec04492 100644 --- a/docs/ssh-signing.md +++ b/docs/ssh-signing.md @@ -85,7 +85,7 @@ The Keychain prompt for the passphrase appears on first use after each reboot, a ### Windows (without WSL) -WSL2 is the supported route for the devcontainer setup in this repo, since Docker Desktop's WSL2 backend is the supported path. A native Windows launch starts the container only where `USERPROFILE` is set and `HOME` is not, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. Commit signing inside a container started that way is untested. +WSL2 is the supported route for the devcontainer setup in this repo. A native Windows launch has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. Commit signing inside a container started that way is untested. If you must work on Windows directly without a devcontainer, OpenSSH for Windows can sign with `gpg.format=ssh`. From 1bdd608857fc93e879a8bc3baf280e9641764ccc Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:00:48 -0800 Subject: [PATCH 03/11] Define the WSL2 Route and Bound What a Native Launch Has Proved A second local review found the route undefined, since a Docker Desktop WSL2 backend reads as already being on it. The steps also left a persistent HOME and an empty gh mount unanswered. And they named signing as the only untested part of a route only a CLI start has exercised. --- docs/devcontainer.md | 4 ++-- docs/host-setup.md | 2 +- docs/ssh-signing.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 3a487e128..0acf84211 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -102,9 +102,9 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig ## Troubleshooting -**Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. Launching VS Code from Git Bash passes `HOME` to it, and a `HOME` variable set in the Windows environment reaches every launch. `devcontainer.json` substitution has no fallback that picks one of them. WSL2 is the supported route, and each host path must exist under the WSL2 home. +**Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch is outside that route and needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Commit signing inside a container started this way is untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment, so a `HOME` set in the Windows environment rules it out. Otherwise, close every VS Code window, then launch VS Code from the Start menu. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Only a devcontainer CLI start of this route has run, so the VS Code launch, the lifecycle commands, and commit signing are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. diff --git a/docs/host-setup.md b/docs/host-setup.md index 2096d333c..d6b558da1 100644 --- a/docs/host-setup.md +++ b/docs/host-setup.md @@ -6,7 +6,7 @@ Supported hosts: - **Linux** - both the devcontainer flow and the host-install flow. - **macOS** - both the devcontainer flow and the host-install flow. -- **Windows** - the supported devcontainer route is **WSL2**, and native Windows (PowerShell + winget) is supported for the host-install flow described in `README.md`. A native launch of a `catalog/snippets/devcontainer/` definition is outside that route and has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. +- **Windows** - the supported devcontainer route is opening the repo from inside a **WSL2** distribution. Native Windows (PowerShell + winget) is supported for the host-install flow described in `README.md`. A native launch of a `catalog/snippets/devcontainer/` definition opens the repo from Windows instead, and has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. > **Shell assumptions in this doc**: every command snippet below assumes a **POSIX shell** (bash/zsh) and POSIX path conventions (`~/.ssh/...`, `mkdir -p`, `$(...)` command substitution). A block marked `powershell` is the exception. Such a block is the **Windows-native** form of the step it sits in, meant to run in PowerShell rather than translated. On Windows, run the POSIX snippets from **WSL2** or **Git Bash**, since they will not work as-is in PowerShell or `cmd.exe`. The git config and `gh` commands are portable, and only the file and path manipulation differs by shell. diff --git a/docs/ssh-signing.md b/docs/ssh-signing.md index daec04492..f18700ed9 100644 --- a/docs/ssh-signing.md +++ b/docs/ssh-signing.md @@ -85,7 +85,7 @@ The Keychain prompt for the passphrase appears on first use after each reboot, a ### Windows (without WSL) -WSL2 is the supported route for the devcontainer setup in this repo. A native Windows launch has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. Commit signing inside a container started that way is untested. +The supported route for the devcontainer setup in this repo is opening it from inside a WSL2 distribution. A native Windows launch has its own conditions, per [Devcontainer troubleshooting][devcontainer-troubleshooting]. Commit signing inside a container started that way is untested. If you must work on Windows directly without a devcontainer, OpenSSH for Windows can sign with `gpg.format=ssh`. From 952eddcb62c62dfa53cab128140b2a1c3ce1db15 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:05:27 -0800 Subject: [PATCH 04/11] Give a Persistent HOME a Step and State a Native Launch's Evidence The local pass found a persistent HOME told it had no native launch, which removing the variable from one session disproves. It also found "this route" ambiguous, and the evidence sentence silent on what the start depended on. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 0acf84211..08ab372a4 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment, so a `HOME` set in the Windows environment rules it out. Otherwise, close every VS Code window, then launch VS Code from the Start menu. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Only a devcontainer CLI start of this route has run, so the VS Code launch, the lifecycle commands, and commit signing are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is one devcontainer CLI start from scratch copies, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From c94ba31843c863e0d3dd974b1eef4813aa31c19a Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:09:54 -0800 Subject: [PATCH 05/11] Name the Gitconfig and Each Snippet in a Native Launch's Conditions A local pass found the evidence sentence read as one start, and the conditions omitted the gitconfig the container copies. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 08ab372a4..837e1a0db 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is one devcontainer CLI start from scratch copies, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path and `.gitconfig` must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From 2a334d6aeccd50a10a3e5c3f93178e71478270ed Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:15:46 -0800 Subject: [PATCH 06/11] State a Missing Gitconfig's Effect Rather Than Requiring It A local pass found ".gitconfig must exist" unsupported, since it is copied rather than mounted and its absence does not stop a start. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 837e1a0db..e34c39aac 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path and `.gitconfig` must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. The `.gitconfig` copied into the container comes from there too, so its absence leaves the identity and signing settings unset. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From 1ad59b8228a3e51f75543c5de4f11b6440fb4e46 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:19:41 -0800 Subject: [PATCH 07/11] List the Gitconfig Copy Among a Native Launch's Untested Parts A local pass found the sentence stated an extension step no measurement drove. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index e34c39aac..22977f576 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. The `.gitconfig` copied into the container comes from there too, so its absence leaves the identity and signing settings unset. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From 3d439dd36a9414161f8d918b31002aeb1af0992d Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:25:09 -0800 Subject: [PATCH 08/11] State What Docker Does With an Absent Mount Source on Each Route The docs said Docker refuses an absent source, which measures true inside WSL2 and false from Windows. A native launch creates the absent path on the host as an empty directory, and the container starts. --- docs/devcontainer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 22977f576..ded31de37 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -33,7 +33,7 @@ The host SSH key, allowed-signers file, and `gh` config directory are mounted in | `~/.config/git/allowed_signers` | `/home/vscode/.config/git/allowed_signers` | read-only | Maps your email to your public key so `git verify-commit` and `git log --show-signature` work inside the container. | | `~/.config/gh` | `/home/vscode/.config/gh` | read-write | `gh` CLI auth state shared with the host. See [`gh` credential store][gh-credential-store] below. | -Each mount's `source` finds the host home directory by joining `${localEnv:HOME}${localEnv:USERPROFILE}`, so exactly one of those variables must be set. Each host path must also exist under that directory, or Docker refuses the mount. See [Troubleshooting][troubleshooting] for a native Windows launch. +Each mount's `source` finds the host home directory by joining `${localEnv:HOME}${localEnv:USERPROFILE}`, so exactly one of those variables must be set. Each host path must also exist under that directory, since Docker refuses an absent one inside WSL2. See [Troubleshooting][troubleshooting] for a native Windows launch. VS Code Dev Containers automatically copies your host `~/.gitconfig` into the container at startup. So `user.name`, `user.email`, `user.signingkey`, `gpg.format`, and `commit.gpgsign` propagate without an explicit mount. @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount source can be missing. Creating it empty shares no `gh` login with the host. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Docker creates an absent one on the host as an empty directory and starts the container, even where the path names a key file. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From 2145758e65b9ba0ce885562785280e6d62dc386f Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:30:26 -0800 Subject: [PATCH 09/11] Give the Directory Docker Creates a Way Out and Scope It to Its Backend A local pass found the created directory blocks the host setup steps with no documented remedy. A real start against an empty home measures that, and the evidence sentence now names the backend. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index ded31de37..6e15d1d7b 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. Docker creates an absent one on the host as an empty directory and starts the container, even where the path names a key file. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` of a scratch copy of each snippet, using a synthetic home and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. On Docker Desktop's WSL2 backend, an absent one becomes an empty host directory and the container still starts, even for a key file. Such a directory blocks the host setup steps that write that file, so delete it and create the file before launching again. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` on Docker Desktop's WSL2 backend. It used scratch copies of the snippets, a synthetic home, and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From 0f456e564bd8f265fa2244023b733ad8bc7c3fc1 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:38:59 -0800 Subject: [PATCH 10/11] Rebuild the Container After Replacing a Directory Docker Created A local pass, then a measurement, found the old container cannot restart once its mount source changes from a directory to a file. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index 6e15d1d7b..a64298759 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. On Docker Desktop's WSL2 backend, an absent one becomes an empty host directory and the container still starts, even for a key file. Such a directory blocks the host setup steps that write that file, so delete it and create the file before launching again. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` on Docker Desktop's WSL2 backend. It used scratch copies of the snippets, a synthetic home, and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. On Docker Desktop's WSL2 backend, an absent one becomes an empty host directory and the container still starts, even for a key file. Such a directory blocks the host setup steps that write that file. Delete it, create the file, then run **Dev Containers: Rebuild Container**, since reopening the old container fails to start it. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` on Docker Desktop's WSL2 backend. It used scratch copies of the snippets, a synthetic home, and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually. From af6fb6af907e2aa983b7c792544714766c491456 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Tue, 3 Nov 2026 22:44:55 -0800 Subject: [PATCH 11/11] Remove the Container Before Replacing a Directory Docker Created A local pass found the rebuild command is hidden in a local window, and the delete ran against a live mount. Removing the container first measures clean, and a plain reopen then creates a new one. --- docs/devcontainer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/devcontainer.md b/docs/devcontainer.md index a64298759..42fd315f6 100644 --- a/docs/devcontainer.md +++ b/docs/devcontainer.md @@ -104,7 +104,7 @@ If `git -c gpg.format=ssh commit -S` errors with `signing failed: no allowed sig **Container fails to start on Windows with `The filename, directory name, or volume label syntax is incorrect`.** A launch with both `HOME` and `USERPROFILE` set joins them into an invalid bind-mount path. VS Code launched from Git Bash can inherit `HOME`, and a `HOME` variable set in the Windows environment reaches a Start menu launch too. `devcontainer.json` substitution has no fallback that picks one of them. The supported route is opening the repo from inside a WSL2 distribution, where each host path must exist under the WSL2 home. -A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. On Docker Desktop's WSL2 backend, an absent one becomes an empty host directory and the container still starts, even for a key file. Such a directory blocks the host setup steps that write that file. Delete it, create the file, then run **Dev Containers: Rebuild Container**, since reopening the old container fails to start it. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` on Docker Desktop's WSL2 backend. It used scratch copies of the snippets, a synthetic home, and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. +A native launch opens the repo from Windows, even with Docker Desktop's WSL2 backend, and is outside that route. It needs `HOME` absent from VS Code's environment. Close every VS Code window, then launch VS Code from the Start menu. Where a `HOME` is set in the Windows environment, run `Remove-Item Env:HOME` in PowerShell, then `code .` from that session instead. Each host path must also exist under `%USERPROFILE%`. On Docker Desktop's WSL2 backend, an absent one becomes an empty host directory and the container still starts, even for a key file. Such a directory blocks the host setup steps that write that file. To recover, remove the container, delete that directory, and create the file. Then run **Dev Containers: Reopen in Container**. Windows `gh` defaults to `%AppData%\GitHub CLI` rather than `.config\gh`, so that mount can start empty and share no `gh` login. Evidence for a native launch is a devcontainer CLI `up` on Docker Desktop's WSL2 backend. It used scratch copies of the snippets, a synthetic home, and replaced image tags. So the VS Code launch, its `.gitconfig` copy, the lifecycle commands, and commit signing on a native launch are untested. **Permission denied writing to `~/.ssh/known_hosts` in the container.** The `onCreateCommand` should have chowned `~/.ssh` to `vscode`. Rebuild the container, and if it persists, open a shell and run the same `sudo install -d -m 700 -o vscode -g vscode ~/.ssh` manually.