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

X11 Forwarding with Remote-ssh #10657

Open
6 tasks done
austinjjohn2 opened this issue Jan 23, 2025 · 6 comments
Open
6 tasks done

X11 Forwarding with Remote-ssh #10657

austinjjohn2 opened this issue Jan 23, 2025 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@austinjjohn2
Copy link

austinjjohn2 commented Jan 23, 2025

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

Some of the details are redacted.

Remote-SSH Log

[13:55:35.089] Log Level: 2
[13:55:35.122] SSH Resolver called for "ssh-remote+<server>", attempt 1
[13:55:35.127] remote.SSH.useLocalServer = false
[13:55:35.128] remote.SSH.useExecServer = true
[13:55:35.128] remote.SSH.showLoginTerminal = false
[13:55:35.128] remote.SSH.remotePlatform = 
[13:55:35.128] remote.SSH.path = 
[13:55:35.128] remote.SSH.configFile = 
[13:55:35.129] remote.SSH.useFlock = true
[13:55:35.129] remote.SSH.lockfilesInTmp = false
[13:55:35.129] remote.SSH.localServerDownload = auto
[13:55:35.129] remote.SSH.remoteServerListenOnSocket = true
[13:55:35.129] remote.SSH.defaultExtensions = []
[13:55:35.129] remote.SSH.loglevel = 2
[13:55:35.129] remote.SSH.enableDynamicForwarding = true
[13:55:35.130] remote.SSH.enableRemoteCommand = false
[13:55:35.130] remote.SSH.serverPickPortsFromRange = {}
[13:55:35.130] remote.SSH.permitPtyAllocation = false
[13:55:35.130] remote.SSH.preferredLocalPortRange = undefined
[13:55:35.130] remote.SSH.useCurlAndWgetConfigurationFiles = false
[13:55:35.130] remote.SSH.experimental.chat = true
[13:55:35.130] remote.SSH.experimental.enhancedSessionLogs = true
[13:55:35.151] VS Code version: 1.96.4
[13:55:35.151] Remote-SSH version: remote-ssh@0.116.1
[13:55:35.151] win32 x64
[13:55:35.166] SSH Resolver called for host: <server>
[13:55:35.166] Setting up SSH remote "<server>"
[13:55:35.189] Using commit id "cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba" and quality "stable" for server
[13:55:35.195] Script variables:
 {
  "ExitCode.0": "OK",
  "ExitCode.64": "LinuxPrereqs",
  "ExitCode.65": "ProxyAuthenticationRequired",
  "ExitCode.128": "UnparsableOutput",
  "ExitCode.129": "EmptyOutput",
  "ExitCode.131": "UnhandledResolverExitCode",
  "ExitCode.132": "OfflineError",
  "ExitCode.133": "SshInstall",
  "ExitCode.134": "FindLocalPort",
  "ExitCode.135": "Timeout",
  "ExitCode.136": "ExhaustedRetries",
  "ExitCode.137": "PermissionDenied",
  "ExitCode.138": "MitmPortForwardingDisabled",
  "ExitCode.139": "Canceled",
  "ExitCode.140": "BadLocalDownloadRequest",
  "ExitCode.141": "LocalDownloadFailed",
  "ExitCode.142": "LocalLockTimeout",
  "ExitCode.143": "NoBash",
  "ExitCode.144": "InvalidHostName",
  "ExitCode.145": "BadInstallScriptResult",
  "ExitCode.146": "ShellRequestFailedOnChannel",
  "ExitCode.147": "InvalidPortRange",
  "ExitCode.148": "SendDisconnectBrokenPipe",
  "ExitCode.149": "LocalServerCrashed",
  "ExitCode.150": "NoFreePortInRange",
  "ExitCode.151": "InvalidCustomServerPath",
  "ExitCode.192": "AlreadyInProgress",
  "ExitCode.193": "ServerDownloadFailed",
  "ExitCode.194": "NoDownloaderAvailable",
  "ExitCode.195": "NoDownloaderAvailableForStatusCheck",
  "ExitCode.196": "UnsupportedArch",
  "ExitCode.197": "StatusCheckFailed",
  "ExitCode.198": "NeedInsidersArch",
  "ExitCode.199": "ServerTransferFailed",
  "ExitCode.200": "ServerFailedToStart",
  "ExitCode.201": "NeedInsidersWindows",
  "ExitCode.202": "CreateInstallDirFailed",
  "ExitCode.203": "UnsupportedPlatform",
  "ExitCode.204": "ServerTerminatedCVE20201416",
  "ExitCode.205": "UnpackFailed",
  "ExitCode.206": "ChangeDirFailed",
  "ExitCode.1023": "UnclassifiedError",
  "ExitCode.OK": "0",
  "ExitCode.LinuxPrereqs": "64",
  "ExitCode.ProxyAuthenticationRequired": "65",
  "ExitCode.UnparsableOutput": "128",
  "ExitCode.EmptyOutput": "129",
  "ExitCode.UnhandledResolverExitCode": "131",
  "ExitCode.OfflineError": "132",
  "ExitCode.SshInstall": "133",
  "ExitCode.FindLocalPort": "134",
  "ExitCode.Timeout": "135",
  "ExitCode.ExhaustedRetries": "136",
  "ExitCode.PermissionDenied": "137",
  "ExitCode.MitmPortForwardingDisabled": "138",
  "ExitCode.Canceled": "139",
  "ExitCode.BadLocalDownloadRequest": "140",
  "ExitCode.LocalDownloadFailed": "141",
  "ExitCode.LocalLockTimeout": "142",
  "ExitCode.NoBash": "143",
  "ExitCode.InvalidHostName": "144",
  "ExitCode.BadInstallScriptResult": "145",
  "ExitCode.ShellRequestFailedOnChannel": "146",
  "ExitCode.InvalidPortRange": "147",
  "ExitCode.SendDisconnectBrokenPipe": "148",
  "ExitCode.LocalServerCrashed": "149",
  "ExitCode.NoFreePortInRange": "150",
  "ExitCode.InvalidCustomServerPath": "151",
  "ExitCode.AlreadyInProgress": "192",
  "ExitCode.ServerDownloadFailed": "193",
  "ExitCode.NoDownloaderAvailable": "194",
  "ExitCode.NoDownloaderAvailableForStatusCheck": "195",
  "ExitCode.UnsupportedArch": "196",
  "ExitCode.StatusCheckFailed": "197",
  "ExitCode.NeedInsidersArch": "198",
  "ExitCode.ServerTransferFailed": "199",
  "ExitCode.ServerFailedToStart": "200",
  "ExitCode.NeedInsidersWindows": "201",
  "ExitCode.CreateInstallDirFailed": "202",
  "ExitCode.UnsupportedPlatform": "203",
  "ExitCode.ServerTerminatedCVE20201416": "204",
  "ExitCode.UnpackFailed": "205",
  "ExitCode.ChangeDirFailed": "206",
  "ExitCode.UnclassifiedError": "1023",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "515029357ab6",
  "startMarker": "515029357ab6: running",
  "commitId": "cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba",
  "quality": "stable",
  "token": "11111a11-1a11-1111-aaa1-111aa1a11a11",
  "vscodeAgentFolder": "$HOME/.vscode-server",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-socket",
  "getDownloadServerStartTrigger": "515029357ab6:trigger_server_download",
  "getDownloadServerEndTrigger": "515029357ab6:trigger_server_download_end",
  "getProgressDownloading": "515029357ab6%%1%%",
  "getProgressInstalling": "515029357ab6%%2%%",
  "printVars": "echo \"SSH_AUTH_SOCK==$SSH_AUTH_SOCK==\"\necho \"DISPLAY==$DISPLAY==\""
}
[13:55:35.202] Install and start server if needed
[13:55:35.222] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[13:55:35.226] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[13:55:35.227] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[13:55:35.229] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[13:55:35.229] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[13:55:35.231] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[13:55:35.231] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[13:55:35.233] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[13:55:35.234] Checking ssh with "C:\Program Files (x86)\Automox\ssh.exe -V"
[13:55:35.236] Got error from ssh: spawn C:\Program Files (x86)\Automox\ssh.exe ENOENT
[13:55:35.237] Checking ssh with "C:\Program Files\PuTTY\ssh.exe -V"
[13:55:35.239] Got error from ssh: spawn C:\Program Files\PuTTY\ssh.exe ENOENT
[13:55:35.239] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[13:55:35.389] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

[13:55:35.401] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 50950 <server> sh
[13:55:35.404] Generated SSH command: 'type "C:\Users\<user>\AppData\Local\Temp\vscode-linux-multi-line-command-<server>-672155791.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 50950 <server> sh'
[13:55:35.405] Using connect timeout of 17 seconds
[13:55:35.406] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:55:35.926] > 
[13:55:35.927] Got some output, clearing connection timeout
> 
> 
[13:55:40.258] > 515029357ab6: running
> Script executing under PID: 551796
[13:55:40.298] > Found existing installation at /home/<user>/.vscode-server...
> Starting VS Code CLI...
> printenv:
[13:55:40.365] >     MAIL=/var/mail/<user>
>     USER=<user>
>     SSH_CLIENT=192.168.48.41 50966 22
>     SHLVL=0
>     LD_LIBRARY_PATH=/usr/local/lib:/util/lib
>     HOME=/home/<user>
>     PYTHONUNBUFFERED=yes
>     PERLLIB=/usr/lib/x86_64-linux-gnu/perl5:/util/lib/perl5:/util/lib/perl:/data
> a/1001/omi/tools/lib
>     SCREENDIR=/home/<user>/.screen
>     VISUAL=emacs -nw
>     VERENV=2.0.4
>     LOGNAME=<user>
>     _=/usr/bin/sh
>     SVN_EDITOR=emacs -nw
>     PATH=/home/<user>/.cargo/bin:/home/<user>/scripts/:/util/bin:/data/1001/
> /omi/util/bin:/data/1001/omi/tools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/
> /usr/bin:/sbin:/bin:/usr/games:/util/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/
> /sbin:/usr/local/sbin
>     LANG=en_US.UTF-8
>     XDG_DATA_HOME=<server path>
>     LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;0
> 01:cd=40;33;01:or=01;36:mi=00;31:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=
> =37;44:ex=00;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha
> a=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:
> :*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.
> .lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:
> :*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;
> ;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=
> =01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*
> *.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01
> 1;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.m
> mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;
> ;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf
> f=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*
> *.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35
> 5:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=0
> 00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.
> .ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36
>     SSH_AUTH_SOCK=/tmp/ssh-AmCkTT8j6J/agent.551795
>     SHELL=/usr/bin/bash
>     HOST=<server>
>     LC_ALL=C
>     PWD=/user/1001/home/<user>
>     SSH_CONNECTION=192.168.48.41 50966 192.168.54.83 22
>     PYTHONPATH=
>     MANPATH=
>     EDITOR=emacs -nw
> Removing old logfile at /home/<user>/.vscode-server/.cli.cd4ee3b1c348a13bafd8f
> f9ad8060705f6d4b9cba.log
[13:55:40.468] > Spawned remote CLI: 552166
> Waiting for server log...
> Waiting for server log...
[13:55:40.588] > Waiting for server log...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
[13:55:40.717] > Waiting for server log...
> Waiting for server log...
> Waiting for server log...
[13:55:40.812] > 515029357ab6: start
> listeningOn==/tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1==
> osReleaseId==ubuntu==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==465==
> execServerToken==11111a11-1a11-1111-aaa1-111aa1a11a11==
> platformDownloadPath==cli-alpine-x64==
> SSH_AUTH_SOCK==/tmp/ssh-AmCkTT8j6J/agent.551795==
> DISPLAY====
> 515029357ab6: end
[13:55:40.813] Received install output: 
listeningOn==/tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1==
osReleaseId==ubuntu==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==465==
execServerToken==11111a11-1a11-1111-aaa1-111aa1a11a11==
platformDownloadPath==cli-alpine-x64==
SSH_AUTH_SOCK==/tmp/ssh-AmCkTT8j6J/agent.551795==
DISPLAY====

[13:55:40.815] Remote server is listening on socket /tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1
[13:55:40.816] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"socketPath":"/tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1"},"osReleaseId":"ubuntu","arch":"x86_64","sshAuthSock":"/tmp/ssh-AmCkTT8j6J/agent.551795","display":"","tmpDir":"/tmp","platform":"linux","execServerToken":"11111a11-1a11-1111-aaa1-111aa1a11a11"},"serverStartTime":465,"installUnpackCode":""}
[13:55:40.833] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:50952:/tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1 <server> sh
[13:55:40.837] Spawning tunnel with: type "C:\Users\ajohn\AppData\Local\Temp\vscode-linux-multi-line-command-<server>-258234804.sh" | "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -L 127.0.0.1:50952:/tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1 <server> sh
[13:55:40.838] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[13:55:41.243] > 
> 
[13:55:46.001] > /tmp/ssh-NM2UcqxeUx/agent.552263
> -e Connected to SSH Host - Please do not close this terminal
[13:55:46.002] Spawned SSH tunnel between local port 50952 and remote target socket /tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1
[13:55:46.003] Waiting for ssh tunnel to be ready
[13:55:46.011] Tunneled socket /tmp/code-277489e9-a883-499a-b505-1ef5f79ce6f1 to local port 50952
[13:55:46.011] Resolved "ssh-remote+<server>" to "port 50952"
[13:55:46.045] Initizing new exec server for ssh-remote+<server>
[13:55:46.046] Resolving exec server at port 50952
[13:55:46.381] Exec server for ssh-remote+<server> created and cached
[13:55:46.383] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-AmCkTT8j6J/agent.551795" "/tmp/vscode-ssh-auth-sock-731332201"
[13:55:46.384] Using cwd: vscode-remote://ssh-remote%2B<server>/
[13:55:46.385] Remote extension host environment: {"SSH_AUTH_SOCK":"/tmp/vscode-ssh-auth-sock-731332201"}
[13:55:46.415] ------




[13:55:46.417] No hints found in the recent session.
[13:55:46.663] [server] Checking /home/<user>/.vscode-server/cli/servers/Stable-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/log.txt and /home/<user>/.vscode-server/cli/servers/Stable-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/pid.txt for a running server...
[13:55:46.778] [server] Installing and setting up Visual Studio Code Server...
[13:55:46.779] [server] Server setup complete
[13:55:46.780] [server] Starting server...
[13:55:46.781] [server] Starting server with command... Command { std: "/home/<user>/.vscode-server/cli/servers/Stable-cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/server/bin/code-server" "--connection-token=remotessh" "--accept-server-license-terms" "--start-server" "--enable-remote-auto-shutdown" "--socket-path=/tmp/code-ab96b77a-b1dc-4da2-83d0-05b6e0b8f156", kill_on_drop: false }
[13:55:47.546] [server] *
[13:55:47.619] [server] * Visual Studio Code Server
[13:55:47.620] [server] *
[13:55:47.620] [server] * By using the software, you agree to
[13:55:47.621] [server] * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
[13:55:47.622] [server] * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
[13:55:47.623] [server] *
[13:55:47.623] [server] Server bound to /tmp/code-ab96b77a-b1dc-4da2-83d0-05b6e0b8f156
[13:55:47.624] [server] Extension host agent listening on /tmp/code-ab96b77a-b1dc-4da2-83d0-05b6e0b8f156
[13:55:47.625] [server] parsed location: "/tmp/code-ab96b77a-b1dc-4da2-83d0-05b6e0b8f156"
[13:55:47.626] [server] 
[13:55:47.626] [server] Server started
[13:55:47.706] [server] [13:55:40] 
[13:55:47.706] [server] 
[13:55:47.706] [server] 
[13:55:47.707] [server] 
[13:55:47.951] [server] [13:55:41] Extension host agent started.
[13:55:48.226] [server] [13:55:41] [<unknown>][634734eb][ExtensionHostConnection] New connection established.
[13:55:48.338] [server] [13:55:41] [<unknown>][e1e12d09][ManagementConnection] New connection established.
[13:55:48.962] [server] [13:55:42] [<unknown>][634734eb][ExtensionHostConnection] <552966> Launched Extension Host Process.
[13:55:53.945] [server] [13:55:42] [network] #1: https://main.vscode-cdn.net/extensions/marketplace.json - error GET AggregateError [ETIMEDOUT]: 
[13:55:55.190] Opening exec server for ssh-remote+<server>
[13:55:55.394] Opening exec server for ssh-remote+<server>
[13:55:56.743] Verified and reusing cached exec server for ssh-remote+<server>
[13:55:56.744] No hints found in the recent session.
[13:55:56.746] Verified and reusing cached exec server for ssh-remote+<server>
[13:55:56.747] No hints found in the recent session.
[13:56:00.330] Opening exec server for ssh-remote+<server>
[13:56:00.732] Verified and reusing cached exec server for ssh-remote+<server>
[13:56:00.733] No hints found in the recent session.
[13:56:01.280] "Update SSH_AUTH_SOCK" terminal command done

Expected Behavior

I currently ssh using the SSH_AUTH_SOCK variable to pipe PIV card information through pageant using the wsl-ssh-pageant tool.
This ssh goes through a bastion and then connects to the server I want to. I've followed suggestions mentioned in issue [#267] and [#589]. I set the Display variable in windows to localhost:0.0 hoping the remote-ssh extension would pick that up and pass it on through to enable x11 through the terminal

Actual Behavior

Remote-ssh never seems to actually set the DISPLAY variable in the bash terminal (of the remote server). I can get x11 to work if I first start a putty session, get the display variable from putty and manually set that in the bash terminal. But it doesnt do it manually and connect with Xming.

Steps To Reproduce

This is my config file. I've tried both ssh -X and ssh -Y along with turning on both ForwardX11 and ForwardX11Trusted. Ive also tried setting a remotecommand also to no avail.

Host <hosts>
  User <user>
  ProxyCommand ssh -XY -l <user> <bastion server> -W %h:%p
  ServerAliveCountMax 4
  ServerAliveInterval 15
  TCPKeepAlive yes

  ControlMaster auto
  # ControlPath ~/.ssh/multiplex/master-%r@%h:%p
  ControlPersist 3600

  # Add LocalForward ports to open more ports
  # Opening Port 9801 to Forward Jupyter Notebook Server.
  LocalForward 9801 localhost:9801

  # Sets the DISPLAY Variable 
  # RemoteCommand export DISPLAY=localhost:10.0

  Protocol 2
  ForwardAgent yes
  ForwardX11 yes
  ForwardX11Trusted yes
  
  PKCS11Provider "C:\Program Files\OpenSC Project\OpenSC\pkcs11\opensc-pkcs11.dll"

Anything else?

Ive also tried using the Remote-X11 extension (didnt work) but Id like to ideally get it working with remote-ssh

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

joshspicer commented Jan 23, 2025

Thanks for the detailed issue. Is the primary ask here to set the DISPLAY variable?

Have you tried the terminal.integrated.env.linux. Adding that setting is an easy way to set environment variables in the remote terminal. You'll likely also need those X11 configuration changes

Image

Please let me know if this helps

@joshspicer joshspicer added the info-needed Issue requires more information from poster label Jan 23, 2025
@austinjjohn2
Copy link
Author

I guess the primary ask is for X11 to work through remote-ssh and forwarded through to XLaunch/Xming.
I'm not sure how but it seems like Putty just sets a localhost variable and passes it through to XLaunch
I saw that setting the DISPLAY variable in windows would work to pass it through to the remote server and that was what I was trying to recreate. Setting the terminal.integrated.env.linux doesnt seem to work. My DISPLAY variable in the remote session remains unset (perhaps because I hop through a bastion?)

Is there another approach or something else I need to do to get X11 working through Remote-SSH?

@austinjjohn2
Copy link
Author

Appending to my previous. Bug #589 mentions that it's added to the extension and should just work.
Is there anything else one would have to do or set to make it work?

@Aninditastevani
Copy link

Aninditastevani commented Jan 29, 2025 via email

@pavelbatyr
Copy link

Maybe "Remote-SSH: Kill Current VS Code Server", followed by "Reload Window" would fix it. That's the only reliable way for me to update SSH_AUTH_SOCK environment variable in the terminal, to get Agent Forwading working. Maybe the same thing applies to your DISPLAY environment variable.

@austinjjohn2
Copy link
Author

Thank you for your reply. Agent Forwarding works for me.
Its X11 Forwarding through the extension that doesnt work for me.

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

No branches or pull requests

4 participants