microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 277 forks source link

[Dev Containers] Add remote.SSH.serverInstallPath equivalent for Dev Containers #9432

Open ntessman-capsule opened 7 months ago

ntessman-capsule commented 7 months ago

There is the remote.SSH.serverInstallPath setting for Remote - SSH, but no way to change where Visual Studio is installed when attaching to containers. This makes it impossible to attach VSCode to containers where home permissions are restricted.

I am referring specifically to the "Attach Visual Studio Code" menu item when right clicking a Kubernetes pod in the Clusters extension window. It will attempt (and fail) to install to the home directory.

ggcr commented 6 months ago

I do not know if that's your case but by creating a symbolic link between my home path and the desired path I was able to overcome this issue.

mkdir -p /your/desired/path/.vscode-remote-containers
ln -s /your/desired/path/.vscode-remote-containers /home/<user>/.vscode-remote-containers

Note that your desired path should be the same as where your .vscode-server is.

This is a solution but Microsoft devs should add this as a setting :(

ntessman-capsule commented 6 months ago

The issue is that it never creates the remote container folder in the first place, because the SSH user doesn't have permission to create folders in the home directory. I can create folders in other directories, but not the one VSCode wants to use.

A setting to change the destination folder would resolve this issue.