vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

devcontainer vscode settings not taking effect in remote container

Open navels opened this issue 2 years ago • 6 comments

  • VSCode Version: 1.71.0 (Universal)
  • Local OS Version: macOS Monterey 12.5.1
  • Local chip architecture: Apple Silicon
  • Reproduces in: Remote - Containers

Maybe I'm not understanding how this is supposed to work . . .

I have a devcontainer.json to which I added some settings:

  "customizations": {
    "vscode": {
      "extensions": [...deleted for brevity...],
      "settings": {
        "rubyTestExplorer.testFramework": "rspec",
        "rubyTestExplorer.logpanel": true,
        "rubyTestExplorer.debugCommand": "rdebug-ide",
        "rubyTestExplorer.filePattern": [
          "*_spec.rb"
        ]
      }
    }

After rebuilding the devcontainer and restarting VSCode I'd expect these settings to be present in my remote container but they are not:

> cat ~/.vscode-server/data/Machine
{}

navels avatar Sep 02 '22 17:09 navels

Aha, I have my home directory in the container mounted to a persistent docker volume, that seems to make the difference . . . is that expected?

navels avatar Sep 02 '22 18:09 navels

Workaround seems to be whenever I need to change the vscode customizations (adding extensions, settings), I have to

rm -rf ~/.vscode-server

and restart vscode.

navels avatar Sep 02 '22 19:09 navels

Transferring as this seems more specific to Remote-Containers than a specific template.

@chrmarti would be great to get your eyes on this one, as it seems unexpected to me.

bamurtaugh avatar Sep 02 '22 20:09 bamurtaugh

The settings are in ~/.vscode-server including a marker file to remember we already copied them there. We could write the container's creation date into the marker file to detect when the container is newer than the settings and these need to be overwritten with the new settings. Other users might expect the current behavior though (e.g., when they have customized the settings).

chrmarti avatar Sep 05 '22 15:09 chrmarti

There is another problem I run into occasionally with vscode because I am persisting my home directory: https://github.com/microsoft/vscode-remote-release/issues/6860

What would mitigate both of these would be a configuration to allow an alternative location for storing the vscode server settings.

navels avatar Sep 12 '22 16:09 navels

https://github.com/microsoft/vscode-remote-release/issues/6079 is tracking making the location of .vscode-server configurable.

chrmarti avatar Sep 13 '22 07:09 chrmarti

Hi @chrmarti, so I realized that the InstallPath for the dev-container is still not configurable. The custom path for installing vscode-server on a remote machine is extremely valuable.

The scenario is as follows: 1-ssh into a remote machine on vscode(with custom InstallPath) 2-attach to running docker container. Here, the dev container vscode-server appears to default to the original home directory(prior to step 1), which in my case, negates the benefits of step 1.

Would it possible to provide such flexibility soon?

arashbehi avatar Feb 16 '23 19:02 arashbehi