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

How to make it work? #1

Open
davide-q opened this issue Oct 31, 2023 · 3 comments
Open

How to make it work? #1

davide-q opened this issue Oct 31, 2023 · 3 comments

Comments

@davide-q
Copy link

In theory, this should work, but in practice it doesn't as described by a gazillion people e.g. in microsoft/vscode-remote-release#6086 microsoft/vscode-remote-release#4474 and microsoft/vscode-remote-release#1722

The root of the problem is that the RemoteCommand is always none. Since I trust this is working for you, I wonder how have you been able to make RemoteCommand work for you when it does not work for anybody else (including myself!)

@davide-q
Copy link
Author

Are you connecting to localhost by any chance? That seems the only option to make this work....

@xangma
Copy link
Owner

xangma commented Nov 6, 2023

Hi, sorry for the delay in replying!

I've definitely had success with RemoteCommand in vscode on Mac and Linux, I think some older versions of ssh on Windows (the one bundled with W11) might have had issues with it? But I haven't converted the script to windows yet anyway.

Ensure you have the RemoteCommand setting enabled in vscode? There's a few options that can disable the RemoteCommand setting in vscode too - e.g disabling the LocalServer setting? This is all from memory though unfortunately.

@DingXuefeng
Copy link

DingXuefeng commented Dec 11, 2023

I confirm I can run on windows with linux remote. relavant settings:

local user settings (json)

{
  "remote.SSH.serverInstallPath": {
    "apptainer~server": "~/.vscode-container/apptainer"
  },
  "remote.SSH.enableRemoteCommand": true,
  "remote.SSH.useLocalServer": true,
  "remote.SSH.remoteServerListenOnSocket": false,
}

key point

  • has no "remote.SSH.remotePlatform" item
  • both "useLocalServer" and "enableRemoteCommand" are set to true
  • use a different "remote.SSH.serverInstallPath" for the container / remote-commanded remote

my C:\Users\me\.ssh\config

Host server apptainer~server
  HostName some.ip.address
  User my_user_name

Host apptainer~*
  RemoteCommand source /cvmfs/cms.cern.ch/cmsset_default.sh && cmssw-el9 -B /datafs -B /publicfs -- /bin/bash -l -c
  RequestTTY force

key points:

  • verify remote command is executed by doing ssh apptainer~server on a powershell
  • name must match: apptainer~*, apptainer~server, server

Last points

  • if it doesn't work, try CTRL+E, then >remote uninstall (uninstall vscode server), then connect again
  • if still doesn't work, delete ~/.vscode-server and ~/.vscode-container on server, and c:\Users\my_windows_user_name\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh on local

Now I have new issues:

  • I can connect, but if I open a folder, then I cannot open terminal anymore. it reports "/bin/bash" command not found. But if I do not open a folder, I can open the terminal. I can also open the terminal if I connect to apptainer~server directly from powershell.
  • in the terminal, if I try to run code xx to open a folder, I got
Singularity> code .
Unable to connect to VS Code server: Error in request.
Error: connect ENOENT /run/user/1001/vscode-ipc-ae29788f-ea45-4591-93b9-2b72c8cebb88.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'connect',
  address: '/run/user/1001/vscode-ipc-ae29788f-ea45-4591-93b9-2b72c8cebb88.sock'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants