RunpodR
Runpod3mo ago
5 replies
unturned3payload

Shell Initialization Harms VSCode Remote SSH Integration

Hi,

I noticed many of the conveniences offered by VSCode Remote SSH (e.g. git credentials forwarding, the code command, etc.) isn't available when connected to a RunPod instance. After some investigation, it seems that the shell initialization scripts are the culprit.

The provided ~/.bashrc runs source /etc/rp_environment at the very end. Inside this file, among other things, is a hard-coded instruction that sets the PATH:
export PATH="/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"


This removes the paths that VSCode injects into PATH at startup (e.g. /root/.vscode-server/cli/servers/Stable-7d842fb85a0275a4a8e4d7e040d2625abbf7f084/server/bin/remote-cli), causing various features of the Remote SSH session to be dysfunctional.

Can this hard-coded PATH behavior be improved? When I comment-out the offending line in /etc/rp_environment, the PATH I end up with is:
/root/.vscode-server/cli/servers/Stable-7d842fb85a0275a4a8e4d7e040d2625abbf7f084/server/bin/remote-cli:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.vscode-server/data/User/globalStorage/github.copilot-chat/debugCommand

Which seems perfectly reasonable to me. Not sure why /etc/rp_environment needs to hard-code a PATH again?
Was this page helpful?