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

Cannot use Remote Development extension pack #196

Closed
2 tasks done
qlan3 opened this issue Jun 12, 2019 · 22 comments
Closed
2 tasks done

Cannot use Remote Development extension pack #196

qlan3 opened this issue Jun 12, 2019 · 22 comments
Labels
bug Something isn't working

Comments

@qlan3
Copy link

qlan3 commented Jun 12, 2019

Describe the bug
I cannot use Remote Development extension pack.

Please confirm that this problem is VSCodium-specific

  • This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn't already documented

To Reproduce
Steps to reproduce the behavior:

  1. Install Remote Development extension pack.
  2. Press F1 and execute "Remote-SSH: Open configuration file" command.
  3. See error "command 'opensshremotes.openConfigFile' not found" at the bottom right.

Expected behavior
The configuration file is open.

Screenshots
If applicable, add screenshots to help explain your problem.
图片

Desktop (please complete the following information):

  • OS: Mac OS
  • Architecture x64
  • Version 1.35.0
@qlan3 qlan3 added the bug Something isn't working label Jun 12, 2019
@stripedpajamas
Copy link
Member

I expect this is not working for very similar reasons as #128 -- the functionality is still considered a "proposal". As such, MS lists the allowed proposals in the product.json file pre-build. Their current list (1.35.0) is:

[ 'ms-vscode.references-view',
  'ms-vsliveshare.vsliveshare',
  'ms-vsliveshare.cloudenv',
  'ms-vsliveshare.cloudenv-explorer',
  'GitHub.vscode-pull-request-github',
  'Microsoft.vscode-nmake-tools',
  'atlassian.atlascode',
  'ms-vscode-remote.remote-containers',
  'ms-vscode-remote.remote-containers-nightly',
  'ms-vscode-remote.remote-ssh',
  'ms-vscode-remote.remote-ssh-nightly',
  'ms-vscode-remote.remote-ssh-edit',
  'ms-vscode-remote.remote-ssh-edit-nightly',
  'ms-vscode-remote.remote-ssh-explorer',
  'ms-vscode-remote.remote-ssh-explorer-nightly',
  'ms-vscode-remote.remote-wsl',
  'ms-vscode-remote.remote-wsl-nightly',
  'ms-vscode-remote.vscode-remote-extensionpack',
  'ms-vscode-remote.vscode-remote-extensionpack-nightly' ]

Our current list is:

[ 'ms-vscode.references-view', 'ms-vsliveshare.vsliveshare' ]

We can get Remote Development working by adding these proposals pre-build, as we are adding the liveshare proposal.

@qlan3
Copy link
Author

qlan3 commented Jun 13, 2019

Thanks!@stripedpajamas
I can use Remote Development extension pack now. There is still an error. When I try to connect to a server, I get this error: "Failed to connect to the remote extension host server (Error: Connection error: Version mismatch, client refused.)". However, I can use VS code to connect the server.

@brianclinkenbeard
Copy link

FYI (since inclusion is being discussed and also some vscodium users seem to care about this) the remote development pack is at least currently not FOSS.

@stripedpajamas
Copy link
Member

@qlan3 unfortunately the server side code is not open source, so I don't know what conditions cause that error message. I would suspect it is because only Visual Studio Code is supported. Also, as @brianclinkenbeard mentioned, this feature if not freely licensed. This link as additional links to other related licenses to do with the Remote Dev extension, and they all restrict use to a "validly licensed copy of Microsoft Visual Studio Code". VSCodium (or a manual build of the vscode repo) do not fall into this category.

Will close this out for now, as I don't think there's anything further we can do until the licensing opens up or it's taken out of beta.

@tlrdstd
Copy link

tlrdstd commented Aug 20, 2019

I've bounced off this several times, so leaving a breadcrumb trail here for others. Combining this ticket, this bug report, and these docs, I did the following on my Mac, after installing vscodium via https://formulae.brew.sh/cask/vscodium:

vim /Applications/VSCodium.app/Contents/Resources/app/product.json
# edit extensionAllowedProposedApi to read:
"extensionAllowedProposedApi": ["ms-vscode.references-view", "ms-vsliveshare.vsliveshare", "ms-vscode-remote.vscode-remote-extensionpack", "ms-vscode-remote.remote-ssh"],

That gets me past the command 'opensshremotes.*' not found errors, but I still can't connect due to:

Failed to connect to the remote extension host server (Error: Connection error: Version mismatch, client refused.)

I filed microsoft/vscode-remote-release#967 , and it appears to be a deliberate licensing choice by Microsoft to not allow use of the Remote Development extension pack with vscodium (as others have mentioned above).

No new information here, but wanted to put all the known details in one place.

@rawtaz
Copy link

rawtaz commented Nov 30, 2019

FWIW, I questioned the limitation in the extension over at microsoft/vscode-remote-release#1925 .

@tyoc213
Copy link

tyoc213 commented Apr 27, 2021

As version 1.55.2 I can't execute ms-vscode-remote.remote-containers

pinging @stripedpajamas

Do we have an ETA?

@bluppfisk
Copy link

following. Is the only way to get it to build it ourselves or is there something we can change in the configuration?

@firelizzard18
Copy link

Microsoft explicitly doesn't want you to use the remote development extensions with anything except official Microsoft VSCode. microsoft/vscode-remote-release#967 quotes the license, which used to explicitly say you are only allowed to use these extensions with official VSCode. I don't read legalese, but unless something has changed, the remote extensions cannot be legally used with anything but VSCode (though the license may not actually hold up in court).

So unless Microsoft changes their mind, the only way to get these features is to re-implement them.

@AdvisedlyAlburn
Copy link

AdvisedlyAlburn commented Oct 12, 2021

I've made a list of the vscode extensions that I use and I noticed that 3 of them are closed source. As you can see, Microsoft is slowly starting to close-source some key vscode extensions. Give it 5 years and I bet you that it will be like Android, with an open source core but all the "extensions" closed source.

I tried to find vscode alternatives because I can clearly see where Microsoft is headed, so I made a list of IDEs. It's not good as you can see :

  • general purpose IDEs
    • Open source
      • not for profit companies
        • Eclipse (2001, EPL license)
      • for profit companies
        • vscode (2015, Microsoft)
        • atom (2014, Github, now owned by Microsoft)
        • intellij Idea CE (2001, Jetbrains) -> has a closed-source pro version too
      • platform specific
        • Textmate -> macos
        • Notepad++ -> windows
    • closed source
      • sublime (2008)
      • visual studio (1997)

I hope new projects will come up, but given the complexity of modern IDEs, we're kinda screwed.

@skbeh
Copy link

skbeh commented Dec 31, 2021

If you meet "Connection error: Unauthorized client refused", just change !valid in https://github.com/microsoft/vscode/blob/36bb6a6848574d883e0310885ebf2cf3269c48b9/src/vs/server/remoteExtensionHostAgentServer.ts#L664 to false. This will disable the verification.

@daiyam
Copy link
Member

daiyam commented Dec 31, 2021

Interesting! It was added in October.

@daiyam
Copy link
Member

daiyam commented Dec 31, 2021

@skbeh Yep, it's the way to go 😉

@daiyam
Copy link
Member

daiyam commented Dec 31, 2021

I was able to patch the client and server to make it work with VSCodium. I don't know how to make it available to others...

@firelizzard18
Copy link

firelizzard18 commented Dec 31, 2021

@AdvisedlyAlburn I think you're being a bit alarmist. Closed-source extensions are a minority and there isn't much evidence of a trend towards more closed source extensions from Microsoft. You can't blame Microsoft for the fact that Google made a closed-source GCP extension. The closed source remote extensions are obviously on Microsoft - my guess is that those are closed source because the remote editing capabilities gives VSCode a competitive edge and they want to retain that as long as possible. Pylance is probably about that too.

However, most of the popular VSCode extensions are open source and built around open source tools. Even if Microsoft did start close-sourcing their other extensions, the community could easily fork them. And since the tools they are built around are open source, the community could create their own extensions for those tools. And if VSCode goes totally to hell, we can move on to one of it's fully open source forks.

@krishnakumarg1984
Copy link

@daiyam Please do share the patching process.

@RDHB
Copy link

RDHB commented Jan 31, 2022

What is the way to make the extension work in vscodium?

@skbeh
Copy link

skbeh commented Feb 16, 2022

On this time, just change 153,2515 of ~/.vscode-server-oss/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/out/vs/server/remoteExtensionHostAgent.js,
which is !ye to false.

@0reo
Copy link

0reo commented Feb 16, 2022

I had to edit ~/.vscode-server-oss/bin/f80445acd5a3dadef24aa209168452a3d97cc326/out/vs/server/node/server.main.js, and search for client refused string. the variable for the if statement will likely be named differently but it's there. I also had to first install the extension in normal vscode first, and then copy the extension folders into the path for vscodium at %userprofile%/.vscode-oss/extensions

@IvanDL95
Copy link

IvanDL95 commented Apr 6, 2022

Where is the ~/.vscode-server-oss/bin supposed to be? The .vscode-server-oss doesn't show up in my home directory. Both the server.main.js and remoteExtensionHostAgent.js doesn't show up in any of the home of vscodium for the flatpak, the snap nor the .deb package (as far as I found, for the .deb inside ~/.config and for the flatpak in ~/.var/app/com.vscodium.codium/ and in the system folder in /var/lib/flatpak/app, didn't bother too much with the snap).

I can install the extension with the docs workaround, both in the .deb and the flatpak (plus the docker socket override for this one), but nothing happens, not even the "command 'opensshremotes.openConfigFile' not found" message shows up.

@IvanDL95
Copy link

IvanDL95 commented Apr 7, 2022

So I fiddled a little more with bits from here and there between vscode, vscodium and flatpak vscodium and I've got the full steps to make it run. I know the flatpak is unnoficial but whatever, I'm gonna put the extra step and someone can link it from there. I guess making docker visible when using a .deb build comes "by default" as it has access to the same things as the user (assuming the user in the docker group).

  1. To be able to install the extension I followed this repo docs to enable the microsoft marketplace.

  2. I added this config (again from the docs).

  3. I came across with issue #1034, seems unrelated, but it says something about product.json that I'm not willing to check after going around poking the config, So I was left with this config product.json:

{
  "extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items",
    "controlUrl": "",
    "recommendationsUrl": ""
  },
  "extensionAllowedProposedApi": [
    "GitHub.codespaces",
    "GitHub.copilot-nightly",
    "GitHub.copilot",
    "GitHub.vscode-pull-request-github-insiders",
    "GitHub.vscode-pull-request-github",
    "GitHub.remotehub",
    "GitHub.remotehub-insiders",
    "Microsoft.vscode-nmake-tools",
    "ms-dotnettools.dotnet-interactive-vscode",
    "ms-python.gather",
    "ms-python.python",
    "ms-toolsai.jupyter",
    "ms-toolsai.vscode-ai",
    "ms-toolsai.vscode-ai-remote",
    "ms-vscode-remote.remote-containers-nightly",
    "ms-vscode-remote.remote-containers",
    "ms-vscode-remote.remote-ssh-edit-nightly",
    "ms-vscode-remote.remote-ssh-edit",
    "ms-vscode-remote.remote-ssh-nightly",
    "ms-vscode-remote.remote-ssh",
    "ms-vscode-remote.remote-ssh-serverless",
    "ms-vscode-remote.remote-wsl",
    "ms-vscode-remote.remote-wsl-recommender",
    "ms-vscode-remote.vscode-remote-extensionpack-nightly",
    "ms-vscode-remote.vscode-remote-extensionpack",
    "ms-vscode.azure-account",
    "ms-vscode.azure-sphere-tools-ui",
    "ms-vscode.azure-sphere-tools",
    "ms-vscode.js-debug-nightly",
    "ms-vscode.js-debug",
    "ms-vscode.lsif-browser",
    "ms-vscode.vscode-selfhost-test-provider",
    "ms-vsliveshare.cloudenv-explorer",
    "ms-vsliveshare.cloudenv",
    "ms-vsliveshare.vsliveshare",
    "ms-vsonline.vsonline",
    "dbaeumer.vscode-eslint",
    "tanhakabir.rest-book",
    "VisualStudioExptTeam.vscodeintellicode",
    "VisualStudioExptTeam.vscodeintellicode-insiders",
    "VisualStudioExptTeam.vscodeintellicode-completions",
    "vscode.vscode-web-playground",
    "ms-azuretools.vscode-azureappservice"
  ],
  "extensionEnabledApiProposals": {
    "ms-dotnettools.dotnet-interactive-vscode": [
      "notebookConcatTextDocument",
      "notebookContentProvider",
      "notebookCellExecutionState",
      "notebookControllerKind",
      "notebookDebugOptions",
      "notebookDeprecated",
      "notebookEditor",
      "notebookEditorDecorationType",
      "notebookEditorEdit",
      "notebookLiveShare",
      "notebookMessaging",
      "notebookMime",
      "textDocumentNotebook"
    ],
    "ms-vscode.remote-repositories": [
      "contribRemoteHelp",
      "contribMenuBarHome",
      "contribViewsRemote",
      "contribViewsWelcome",
      "documentFiltersExclusive",
      "extensionRuntime",
      "fileSearchProvider",
      "quickPickSortByLabel",
      "workspaceTrust",
      "scmSelectedProvider",
      "scmValidation",
      "textSearchProvider",
      "timeline",
      "notebookEditor"
    ],
    "ms-vscode-remote.remote-ssh": [
      "resolvers",
      "terminalDataWriteEvent",
      "contribViewsRemote"
    ],
    "ms-vscode-remote.remote-containers": [
      "resolvers",
      "workspaceTrust",
      "terminalDimensions",
      "contribViewsRemote"
    ]
  }
}

In the flatpak, the file should be placed in ~/.var/app/com.vscodium.codium/config/VSCodium/ if using the default path

3.5. This is the extra step I was mentioning. It took me a lot of time as I came with a "drawing the rest of the owl moment" in [this issue in the vscode flatpak[(https://github.com/flathub/com.visualstudio.code/issues/203). I found the full explanation of how to do it here. It's for podman, but the steps are exaclty the same just that instead of --host podman it's --host docker and you have to also replace the Docker Compose Path.

  1. What @0reo and @skbeh were saying it's ~/.vscode-server-oss/bin and confused me it was inside the home folder of the root user inside the docker container. So what it's actually the thing to do is:

    a. Go to the docker container
    b. Open /root/.vscode-server-oss/bin/${randomHash}/out/vs/server/node/server.main.js and search for client refused as @0reo said and search for the if with the negated variable (let's call it !ye) and replace !ye to false as @skbeh dixit.
    c. I had to copy the file code-server to code-server-oss inside of /root/.vscode-server-oss/bin/${randomHash}/bin because, for some reason I don't know. it was looking for the code-server-oss file instead. There will be an error sign and a log behind explicitly stating that it failed because that file doesn't exist if you don't.

  2. Launch/relaunch VScodium if neccesary and see if the Remote Explorer is tab there and it shows the containers instead of a message to install docker and try to attach a codium window to it.

@reesericci
Copy link

wait, what? I'm working in a toolbox and that directory is not inside the toolbox, correct? I am very confused.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests