linuxvisual-studio-coderaspberry-piraspbian-buster

Visual Studio Code does not complete installation of remote execution server on Raspberry Pi O/S Buster


In 2002, I was able to successfully connect Visual Studio Code to my Raspberry Pi-based robot and do remote development with VS Code installed on my Windows 10 laptop and the small remote server shim installed on the robot. However, as of July 2024, things have changed.

  1. The robot's operating system has moved to Raspberry Pi O/S Buster (and, due to library incompatibilities, cannot yet be migrated to Bullseye or Bookworm.)
  2. Visual Studio Code's version has moved from v1.6 to v1.9.

I am trying to recreate the remote environment in the current version of Windows 10 and the current version of Raspberry Pi O/S Buster, but it never completes.

I have the "remote SSH" extension installed and attempt to connect to the remote target:

  1. I select the target.

  2. It asks for the kind of operating system the target has, I respond "Linux"

  3. It asks for the "pi" user's password, which I supply.

  4. It begins downloading the server shim to the robot's operating system.

    There's a pause for about 30 seconds.

  5. It then asks for the kind of operating system the target has, again.

  6. As before, I select "Linux".

  7. I give it the "pi" user's password again.

  8. It starts a second instance of downloading the shim

    There's another pause for about 30 seconds.

  9. The entire process starts again, seemingly without end.

Note:

  1. It will repeat this for as long as I continue to do this dance with VS Code.

  2. No amount of waiting will cause it to eventually succeed.

I have uninstalled, installed, re-installed, (repeatedly), and nothing seems to help. I have also removed the .vscode-server directory in /home/pi on the robot itself, all to no avail.

I saw a previous article that mentioned that there was a change made in Visual Studio Code and that reverting to version 1.8.5 would solve the problem. However, if I install the older version, none of the extensions will load and I cannot find the earlier extensions.

I tried going back to a backup from 2022 and copied over the entire VS Code context from the old backup to my new machine. As soon as I launched the old version of VS Code, it completely invalidated the extensions and updated itself to v1.9n.


To attempt to narrow down the issue I tried running a different version of Buster that I had successfully installed VS Code on. I also installed VS Code 1.69 as that was the current version at that time.

There were a few "gotcha!"s, like making sure that I had an openSSH server installed in Windows, copying the Windows machine's public key to the remote device, and a few other small tweaks and I was running, could connect, could load up a remote workspace, and everything looked good.

So, I tried updating to 1.91.1, (the latest version as of this instant date), launched it, and tried to reconnect as I did before. No good.

I received the repeated attempts to download and setup the remote server. I tried removing the .vscode-server directory as noted in a previous posting and I continue to fail, always receiving the following error:

Failed to connect to the remote extension host server (Error: WrappedError(WrappedError { message: "error checking server integrity", original: "failed to run command \"/home/pi/.vscode-server/cli/servers/Stable-f1e16e1e6214d7c44d078b1f0607b2388f29d729.staging/server/bin/code-server --version\" (code 1): /home/pi/.vscode-server/cli/servers/Stable-f1e16e1e6214d7c44d078b1f0607b2388f29d729.staging/server/node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/pi/.vscode-server/cli/servers/Stable-f1e16e1e6214d7c44d078b1f0607b2388f29d729.staging/server/node)\n" }))

The key part of this error appears to be:

/home/pi/.vscode-server/cli/servers/Stable-f1e16e1e6214d7c44d078b1f0607b2388f29d729.staging/server/node: /lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26' not found

Even after removing the .vscode-server directory, (and seeing it replaced by .vscode-server and .vscode-remote-containers directories), it still did not work and still throws the exact same error.

I am beginning to suspect that "/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.26'" is not compatible with Buster. (I have not tried this with Bullseye nor Bookworm as the porting process to those platforms is ongoing.)

I noticed some people on forum threads elsewhere trying to re-compile gcc to 3.4.26 on their systems and the consensus is it will break the system.

If that's the case, is there a maximum upgrade version that's compatible with Raspberry Pi O/S Buster?


Solution

  • TL;DR: If you're running Raspberry Pi O/S Buster, you're capped at version 1.89.1.

    The problem with upgrading Visual Studio Code to the latest version appears to be that, beginning with version 1.90.n or later, there's a hard dependency on glibc version 3.4.26 and (AFAIK) that won't run/install on Buster.

    Therefore, the latest version I was able to install on Windows 10 that would successfully run remotely on Buster is 1.89.1.

    There's the possibility that containers may be a part of the problem because, beginning with 1.91.n, Visual Studio Code also installs a .vscode-remote-container directory - though I have no idea if this also affects it.