b01 / dl-vscode-server

MIT License
15 stars 4 forks source link

About the actual unpacking location of VSCode Server #14

Open JinFish opened 2 months ago

JinFish commented 2 months ago

Hi, I looked at download-vs-code-server.sh and got a lot out of it! Thank you very much for this script.

However, I found that what was written in the script was to extract vscode-server.tar.gz under ~/.vscode-server/bin/{commit_sha} and copy its contents to ~/.vscode/cli/servers/Stable-${commit_sha}/server.

In my VSCode, however, I simply extracted vscode-server.tar.gz under ~/.vscode/cli/servers/Stable-${commit_sha}/server and can work.

When I connect to my remote host using the Remote SSH plugin, I see the following in the Remote SSH output, which also seems to prove that VSCode is looking for ~/.vscode-server/cli/servers/Stable-${commit_sha}/server instead of ~/.vscode/cli/servers/Stable-${commit_sha}/server or ~/.vscode-server/bin/{commit_sha}:

[16:53:46.345] [server] Checking /home/admin123/.vscode-server/cli/servers/Stable-

dc96b837cf6bb4af9cd736aa3af08cf8279f7685/log.txt and /home/admin123/.vscode-server/cli/servers/Stable-

dc96b837cf6bb4af9cd736aa3af08cf8279f7685/pid.txt for a running server...

So, I made a request to switch .vscode/cli in the script to .vscode-server/cli.

eslowney commented 2 months ago

I run a small offline lab, and have had to figure out how to manually set up vscode-remote SSH w/o an internet connection. This all worked well until 1.89, which is how I found this site (and the previous one). I'm going to test out the paths mentioned here to see if I can't get this to work. Thanks so much to everyone for their research. And no thanks to MS for changing things up with little documentation!

eslowney commented 2 months ago

Ok, to add more info, with v1.89 and SSH Remote 0.112, it appears to want a 2nd program, vscode-cli. This is getting complicated! Note that this is after I already have vscode-server.tar.gz untar'ed, same as all other previous versions.

  1. It looks for a new file called ~/.vscode-server/vscode-cli-${commit_sha}.tar.gz ( and also xxx..tar.gz.done)
  2. Which unpacks to ~/.vscode-server/code (a 20MB single binary, not a folder)
  3. It quickly renames the binary to ~/.vscode-server/code-${commit_sha}
  4. After that it launches the code binary, but I appear to have mis-matched versions of vscode-cli, because it starts up with a bunch of cmdline params, one of which is --on-host, but the new version seems to be --on-port. It then crashes. I'm getting closer...

It looks like they're trying to unite the various remote options (SSH, Tunnels, etc) with one plugin.

JinFish commented 2 months ago

That seems to be the case, so far based on what I've tried it seems to be sufficient to have ~/.vscode-server/cli/servers/Stable-${commit_sha}/server.

b01 commented 2 months ago

Ill not that this is the same as issue #7.

However, I found that what was written in the script was to extract vscode-server.tar.gz under ~/.vscode-server/bin/{commit_sha} and copy its contents to ~/.vscode/cli/servers/Stable-${commit_sha}/server.

Not a copy but a single symbolic link, which servers the same purpose but with less space on disk.

image

These are what are used when you manually make a tunnel to a container to vscode.dev.

image

b01 commented 2 months ago

In my VSCode, however, I simply extracted vscode-server.tar.gz under ~/.vscode/cli/servers/Stable-${commit_sha}/server and can work.

When I connect to my remote host using the Remote SSH plugin, I see the following in the Remote SSH output, which also seems to prove that VSCode is looking for ~/.vscode-server/cli/servers/Stable-${commit_sha}/server instead of ~/.vscode/cli/servers/Stable-${commit_sha}/server or ~/.vscode-server/bin/{commit_sha}:

[16:53:46.345] [server] Checking /home/admin123/.vscode-server/cli/servers/Stable-

dc96b837cf6bb4af9cd736aa3af08cf8279f7685/log.txt and /home/admin123/.vscode-server/cli/servers/Stable-

dc96b837cf6bb4af9cd736aa3af08cf8279f7685/pid.txt for a running server...

So, I made a request to switch .vscode/cli in the script to .vscode-server/cli.

@JinFish Can you please update your PR #13 to add the symlinik ~/.vscode-server/cli/servers/Stable-${commit_sha}/server, but don't remove the other symlink.

That should resolve that issue for anyone that uses Remote SSH.

I'm think there is at least 1 more path out there that I need to confirm.

b01 commented 2 months ago

Ok, to add more info, with v1.89 and SSH Remote 0.112, it appears to want a 2nd program, vscode-cli. This is getting complicated! Note that this is after I already have vscode-server.tar.gz untar'ed, same as all other previous versions.

  1. It looks for a new file called ~/.vscode-server/vscode-cli-${commit_sha}.tar.gz ( and also xxx..tar.gz.done)
  2. Which unpacks to ~/.vscode-server/code (a 20MB single binary, not a folder)
  3. It quickly renames the binary to ~/.vscode-server/code-${commit_sha}
  4. After that it launches the code binary, but I appear to have mis-matched versions of vscode-cli, because it starts up with a bunch of cmdline params, one of which is --on-host, but the new version seems to be --on-port. It then crashes. I'm getting closer...

It looks like they're trying to unite the various remote options (SSH, Tunnels, etc) with one plugin.

While this is a separate issue. It should not be hard to add that for most users. The problem with VS Code CLI is the download links are not consistent like server (so far that I noticed). Hopefully the placement of code binary is not as bad as vscode server.

b01 commented 2 months ago

I put a PR out that that adds a new download script, to eventually replace the current script.

@JinFish It adds a symbolic link to ~/.vscode-server/cli/servers/Stable-${commit_sha}/server

@eslowney You can use this same script to install VS Code CLI (download-vs-code.sh "linux" "x64" --cli), it will install it to ~/.vscode-server/code then make a symbolic link to ~/.vscode-server/code-${commit_sha}.

Please can you try it out and let me know how it goes?

I still need to add documentation for it.

JinFish commented 2 months ago

Indeed, .vscode/cli is useful and should not be deleted. Thank you very much for your reply, which has taught me a lot.