When Copilot works locally but not in a dev container, do not start by deleting or rebuilding the container. Check the connected workspace, extension activation, GitHub account and network error first. A crossed-out Copilot icon can reflect a disabled feature or content exclusion, not just a missing login.
Check the Container Window and Active Copilot Components
Verify the remote indicator shows the intended dev container and that its terminal and project files work. If the container cannot start, use the Dev Containers log to diagnose that problem before troubleshooting Copilot.
Open Extensions in the connected window. VS Code runs extensions either locally or in the container depending on their purpose, and normally chooses the correct installation location. If a required component is disabled because it belongs remotely, use the install action VS Code offers. A configuration-file entry is not the only way to install an extension. See Managing extensions in containers.
Check the Copilot status explanation and selected GitHub account. Follow the official sign-in flow if needed. Do not copy tokens into the container, mount your whole credential directory or add secrets to devcontainer.json to solve an unexplained authentication error.
Make Extension Setup Repeatable Without Replacing Your Configuration
Once manual installation works, you can record project-approved extensions in the existing .devcontainer/devcontainer.json. The current location is customizations.vscode.extensions, not a new top-level extensions property. This fragment illustrates the structure:
{
"customizations": {
"vscode": {
"extensions": [
"GitHub.copilot",
"GitHub.copilot-chat"
]
}
}
}
Merge the required IDs into your existing array; do not replace the whole file or remove its image, build, mounts or other settings. Keep only components required by your supported VS Code setup, and verify installation after reopening. If no dev-container configuration exists, use Dev Containers: Add Dev Container Configuration Files… rather than creating an incomplete file containing only extensions.
Configuration changes may require Dev Containers: Rebuild Container. Before rebuilding, save work and inspect where important files live. The container’s writable layer and manually installed tools may be replaced; bind mounts and volumes have their own persistence rules. Back up anything important outside the known persistent workspace. The container creation guide explains the rebuild cycle.
Match the Remaining Symptom to the Right Check
- No suggestions in selected files: inspect language settings and content-exclusion policy. A policy restriction is not a reason to bypass organization controls.
- Account unavailable: confirm the GitHub account, seat or plan and allowance. Use the supported account menu to reauthenticate if the error warrants it.
- Connection or certificate error: inspect the Copilot output and search the Command Palette for Chat Diagnostics. Determine whether the failing request is local or container-side before changing proxy configuration.
- Generic or incorrect code: check the selected file, language mode and provided context. Missing language tooling can reduce useful project information, but installing a linter does not guarantee correct AI output.
GitHub’s common-issues guide covers policy and account checks. For network failures, use administrator-approved proxy and certificate settings; do not disable TLS verification or put proxy passwords in a committed configuration.
Repeat a small non-sensitive test after each change. If the issue persists, follow the diagnostics guide and report the image, VS Code version, extension versions and exact error. Remove tokens, source code and private paths from logs before sharing them.
Official documentation checked: October 14, 2026.