Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENV cannot take effect #10614

Open
6 tasks done
heartacker opened this issue Jan 7, 2025 · 3 comments
Open
6 tasks done

ENV cannot take effect #10614

heartacker opened this issue Jan 7, 2025 · 3 comments
Assignees
Labels
ssh Issue in vscode-remote SSH

Comments

@heartacker
Copy link

Is there an existing issue for this bug?

  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I did not try step 2 of the troubleshooting steps

Remote-SSH Log

I have add setting to my remote config-folder .vscode/setting.json

    "terminal.integrated.env.linux": {
        "DISPLAY":"acker.xxxxxx.xin:0"
    },

and i open the bash, echo $DISPLAY, it still be :0

Expected Behavior

acker.xxxxxx.xin:0

Actual Behavior

0

Steps To Reproduce

also , i set this config to my local vscode setting.
i get the same result

Anything else?

No response

@heartacker heartacker added the ssh Issue in vscode-remote SSH label Jan 7, 2025
@joshspicer
Copy link
Member

@heartacker Could you share your Remote - SSH log? What happens if, after connecting, you open up a new terminal? Does the environment variable get set?

@meganrogge This setting should be honored, right?

@meganrogge
Copy link

Yes, does it reproduce locally?

@heartacker
Copy link
Author

I find some var can take effect
LIKE

    "terminal.integrated.env.linux": {
         "DISPLAY": "acker.XXXXXX.xin:0"
        "VSCODE_PC_ID": "rog"
    },

Image

mylog

[08:52:59.347] Log Level: 2
[08:52:59.366] VS Code version: 1.96.2
[08:52:59.366] Remote-SSH version: [email protected]
[08:52:59.366] win32 x64
[08:52:59.582] SSH Resolver called for "ssh-remote+nas", attempt 1
[08:52:59.587] remote.SSH.useLocalServer = false
[08:52:59.587] remote.SSH.useExecServer = false
[08:52:59.587] remote.SSH.showLoginTerminal = false
[08:52:59.588] remote.SSH.path = undefined
[08:52:59.588] remote.SSH.configFile = undefined
[08:52:59.588] remote.SSH.useFlock = true
[08:52:59.588] remote.SSH.lockfilesInTmp = true
[08:52:59.588] remote.SSH.localServerDownload = auto
[08:52:59.588] remote.SSH.remoteServerListenOnSocket = true
[08:52:59.588] remote.SSH.defaultExtensions = []
[08:52:59.588] remote.SSH.defaultExtensionsIfInstalledLocally = []
[08:52:59.588] remote.SSH.loglevel = 2
[08:52:59.589] remote.SSH.enableDynamicForwarding = true
[08:52:59.589] remote.SSH.enableRemoteCommand = true
[08:52:59.589] remote.SSH.serverPickPortsFromRange = {}
[08:52:59.589] remote.SSH.serverInstallPath = {}
[08:52:59.589] remote.SSH.permitPtyAllocation = false
[08:52:59.589] remote.SSH.preferredLocalPortRange = undefined
[08:52:59.589] remote.SSH.useCurlAndWgetConfigurationFiles = false
[08:52:59.589] remote.SSH.experimental.chat = false
[08:52:59.589] remote.SSH.experimental.enhancedSessionLogs = false
[08:52:59.601] SSH Resolver called for host: nas
[08:52:59.601] Setting up SSH remote "nas"
[08:52:59.608] Using commit id "fabdb6a30b49f79a7aba0f2ad9df9b399473380f" and quality "stable" for server
[08:52:59.608] Extensions to install: GitHub.copilot, GitHub.copilot-chat
[08:52:59.614] Install and start server if needed
[08:52:59.617] Checking ssh with "C:\Program Files\Microsoft\jdk-11.0.25.9-hotspot\bin\ssh.exe -V"
[08:52:59.619] Got error from ssh: spawn C:\Program Files\Microsoft\jdk-11.0.25.9-hotspot\bin\ssh.exe ENOENT
[08:52:59.619] Checking ssh with "D:\Program Files\Python311\Scripts\ssh.exe -V"
[08:52:59.620] Got error from ssh: spawn D:\Program Files\Python311\Scripts\ssh.exe ENOENT
[08:52:59.620] Checking ssh with "D:\Program Files\Python311\ssh.exe -V"
[08:52:59.621] Got error from ssh: spawn D:\Program Files\Python311\ssh.exe ENOENT
[08:52:59.621] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[08:52:59.622] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[08:52:59.622] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[08:52:59.623] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[08:52:59.623] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[08:52:59.625] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[08:52:59.625] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[08:52:59.627] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[08:52:59.627] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[08:52:59.663] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[08:52:59.671] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 5695 nas bash
[08:52:59.672] Generated SSH command: 'type "C:\Users\ACKERL~1\AppData\Local\Temp\vscode-linux-multi-line-command-nas-436069811.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 5695 nas bash'
[08:52:59.673] Using connect timeout of 17 seconds
[08:52:59.674] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[08:52:59.905] > 
[08:52:59.906] Got some output, clearing connection timeout
[08:53:00.301] > bash:/tmp/zfsv3/nvme12/19921385566/data/home
[08:53:00.314] > 8295f2c7181c: running
[08:53:00.330] > Acquiring lock on /tmp/vscode-remote-lock.19921385566.fabdb6a30b49f79a7aba0f2ad9df9b399473380f
> Found existing installation at /home/19921385566/.vscode-server/bin/fabdb6a30b49f79a7aba0f2ad9df9b399473380f...
> Checking /home/19921385566/.vscode-server/.fabdb6a30b49f79a7aba0f2ad9df9b399473380f.log and /home/19921385566/.vscode-server/.fabdb6a30b49f79a7aba0f2ad9df9b399473380f.pid for a running server
> Looking for server with pid: 65891
[08:53:00.346] > Found running server...
> Installing extensions...
[08:53:00.450] > Installing extensions...
[08:53:00.712] > Extension 'github.copilot' v1.256.1304 is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '[email protected]'.
> Extension 'github.copilot-chat' v0.24.2024121201 is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '[email protected]'.
[08:53:00.724] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
[08:53:00.741] > 
> Checking server status on socket /tmp/vscode-ssh-remote-server-sock-1736381378 w
> with curl
> 8295f2c7181c: start
> SSH_AUTH_SOCK====
> DISPLAY==:0==
> webUiAccessToken====
> listeningOn==/tmp/vscode-ssh-remote-server-sock-1736381378==
> osReleaseId==zos==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime==383==
> serverStartTime====
> connectionToken==1111a111-1aaa-1aa1-a1a1-a11a1a1a1a1a==
> 8295f2c7181c: end
[08:53:00.741] Received install output: 
SSH_AUTH_SOCK====
DISPLAY==:0==
webUiAccessToken====
listeningOn==/tmp/vscode-ssh-remote-server-sock-1736381378==
osReleaseId==zos==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime==383==
serverStartTime====
connectionToken==1111a111-1aaa-1aa1-a1a1-a11a1a1a1a1a==

[08:53:00.741] Remote server is listening on socket /tmp/vscode-ssh-remote-server-sock-1736381378
[08:53:00.741] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"socketPath":"/tmp/vscode-ssh-remote-server-sock-1736381378"},"osReleaseId":"zos","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":":0","tmpDir":"/tmp","platform":"linux","connectionToken":"1111a111-1aaa-1aa1-a1a1-a11a1a1a1a1a"},"extInstallTime":383,"installUnpackCode":""}
[08:53:00.746] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:5698:/tmp/vscode-ssh-remote-server-sock-1736381378 nas bash
[08:53:00.747] Spawning tunnel with: type "C:\Users\ACKERL~1\AppData\Local\Temp\vscode-linux-multi-line-command-nas-673516869.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:5698:/tmp/vscode-ssh-remote-server-sock-1736381378 nas bash
[08:53:00.747] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[08:53:00.757] > 
[08:53:00.996] > 
> 
> Connected to SSH Host - Please do not close this terminal
[08:53:01.553] Spawned SSH tunnel between local port 5698 and remote target socket /tmp/vscode-ssh-remote-server-sock-1736381378
[08:53:01.554] Waiting for ssh tunnel to be ready
[08:53:01.556] Tunneled socket /tmp/vscode-ssh-remote-server-sock-1736381378 to local port 5698
[08:53:01.556] Resolved "ssh-remote+nas" to "port 5698"
[08:53:01.557] Remote extension host environment: {"DISPLAY":":0"}
[08:53:01.566] ------




[08:53:01.566] No hints found in the recent session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

3 participants