vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

remote tunnel to linux aarch64 with /usr/lib fails

Open thorgrimjansrud opened this issue 2 years ago • 5 comments

  • VSCode Version: 1.84.2
  • Local OS Version: Win11
  • Remote OS Version: Debian aarch64-linux-gnu-gcc
  • Remote Extension/Connection Type: remote tunnels
  • Logs:
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[2023-11-29 15:51:56] error This machine not meet Visual Studio Code Server's prerequisites, expected either...:   - find libstdc++.so or ldconfig for GNU environments
  - find /lib/ld-musl-aarch64.so.1, which is required to run the Visual Studio Code Server in musl environments

Steps to Reproduce:

  1. curl -Lk 'https://update.code.visualstudio.com/latest/cli-linux-arm64/stable' --output vscode_cli.tar.gz
  2. tar -xf vscode_cli.tar.gz
  3. ./code tunnel

Continuing from #9229. This must be the same problem as #7495 (also see #7631). Looking into prereqs.rs and "fn check_glibcxx_version()" it seems the "DEFAULT_LIB_PATH" is set to "/usr/lib64" on my device that uses "/usr/lib". Arm32 is supported but when upgrading such to arm64 with same OS paths will then fail..

image

Some info about the device (not supporting ldconfig):

:~ cat /proc/version
Linux version 6.1.38-rt12-w04.02.00 (user@792a7ad1edc9) (aarch64-linux-gnu-gcc (GCC) 11.3.1 20220712, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Nov  8 15:57:24 UTC 2023
:~ /usr/lib/libc.so.6
GNU C Library (GNU libc) stable release version 2.35.
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 11.3.1 20220712.
libc ABIs: UNIQUE ABSOLUTE
For bug reporting instructions, please see:
<https://www.gnu.org/software/libc/bugs.html>.
:~ find / -name "libstdc++.so.6"
/usr/lib/libstdc++.so.6
:/home ldd code
        not a dynamic executable

thorgrimjansrud avatar Nov 29 '23 16:11 thorgrimjansrud

Looking into debian policy manual I try to understand where libstdc++.so.6 should be installed. This to figure out on what side changes need to be implemented.

image

With reference to GNU Debian WSL on my workstation both libc.so and libstdc++.so.6 is located in "/usr/lib/x86_64-linux-gnu/" and not in "/usr/lib64/". On another device (not mine) e.g. RevPi Connect+ with aarch64 GNU/Linux both placed in "/usr/lib/aarch64-linux-gnu/" and shown by "ldconfig -p".

Further and in my case glibc and libstdc++.so.6 should be installed either in "/usr/lib/" or "/usr/lib/something/".

:~ opkg print-architecture 
arch arm64 10 
arch all 1 arch 
noarch 1

I'm not 100% sure but my conclusion is that if libc and libstdc++.so.6 is installed in "/usr/lib" this is correct according to Debian arm64 / aarch64. The policy states "permitting files to instead be installed " but not dont need to be.

So in the case of "DEFAULT_LIB_PATH" it could maybe be configured to be (1) "/usr/lib" in the case of "arm64" architecture or (2) just "/usr/lib/" default where its not discoverable by ldconfig -p.

@connor4312 could you make any sense of this ?

thorgrimjansrud avatar Dec 05 '23 14:12 thorgrimjansrud

I have the same error here, this appears:

 error This machine does not meet Visual Studio Code Server
> r's prerequisites, expected either...
>   - find libstdc++.so or ldconfig for GNU environments
>   - find /lib/ld-musl-aarch64.so.1, which is required to run the Visual Studio C

I'm trying to connect to a local Raspberry Pi 3b+

Feeh03114 avatar Jul 01 '24 18:07 Feeh03114

error This machine does not meet Visual Studio Code Server's prerequisites, expected either...

  • find libstdc++.so or ldconfig for GNU environments
  • find /lib/ld-musl-aarch64.so.1, which is required to run the Visual Studio Code Server in musl environments

Jobians avatar Aug 11 '24 11:08 Jobians

Any solution?

FrankP89 avatar Oct 06 '24 04:10 FrankP89

@FrankP89 yes I solved it my running inside Ubuntu

Jobians avatar Oct 06 '24 12:10 Jobians

I am running ubuntu and facing this issue on latest insiders build

AyushSehrawat avatar Mar 11 '25 15:03 AyushSehrawat

If anyone is trying to use Remote SSH to connect to an Amazon Linux 2023 arm64 EC2, Claude produced this script you can run on your server which worked for me:

# Install patchelf
sudo dnf install -y patchelf

# Check your system's linker and library paths
SYSTEM_LINKER=$(find /lib64 -name "ld-linux-aarch64.so*" | head -n 1)
SYSTEM_LIB_PATH="/lib64:/usr/lib64"

# Set environment variables using your actual system paths
echo "export VSCODE_SERVER_PATCHELF_PATH=$(which patchelf)" >> ~/.bashrc
echo "export VSCODE_SERVER_CUSTOM_GLIBC_LINKER=$SYSTEM_LINKER" >> ~/.bashrc
echo "export VSCODE_SERVER_CUSTOM_GLIBC_PATH=$SYSTEM_LIB_PATH" >> ~/.bashrc

source ~/.bashrc

Here's an article from Microsoft explaining the March 2025 1.99 Remote SSH update: https://code.visualstudio.com/docs/remote/faq#_can-i-run-vs-code-server-on-older-linux-distributions

My original error:

> [2025-03-11 10:59:29] error This machine does not meet Visual Studio Code Server's prerequisites, expected either...
>   - find /lib/ld-musl-aarch64.so.1, which is required to run the Visual Studio Code Server in musl environments

heythisischris avatar Mar 11 '25 16:03 heythisischris

I am running ubuntu and facing this issue on latest insiders build

I'm having the same issue. Insiders acb986b977f3f8827651cbc5efb689f9bbede1ad connecting to ubuntu 22.04 FIPS on x64

Some fiddling gets ldd to be happy

 ldd /home/ubuntu/.vscode-server-insiders/cli/servers/Insiders-acb986b977f3f8827651cbc5efb689f9bbede1ad.staging/server/node
	linux-vdso.so.1 (0x00007fff77da1000)
	libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3e72fd4000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3e786f4000)
	libc.musl-x86_64.so.1 => /lib/x86_64-linux-gnu/libc.musl-x86_64.so.1 (0x00007f3e78644000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3e72eed000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3e72cc4000)
	/lib/ld-musl-x86_64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x00007f3e78716000)

but still end up with symbol errors

$ /home/ubuntu/.vscode-server-insiders/cli/servers/Insiders-acb986b977f3f8827651cbc5efb689f9bbede1ad.staging/server/node --version
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __wmemmove_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __fprintf_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __openat_2: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __strftime_l: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __cxa_thread_atexit_impl: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __mbsnrtowcs_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __wmemset_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __mbsrtowcs_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __wmemcpy_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __sprintf_chk: symbol not found
Error relocating /lib/x86_64-linux-gnu/libstdc++.so.6: __libc_single_threaded: symbol not found
Error relocating /lib/x86_64-linux-gnu/libgcc_s.so.1: _dl_find_object: symbol not found
Error relocating /lib/x86_64-linux-gnu/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /lib/x86_64-linux-gnu/libgcc_s.so.1: __cpu_model: symbol not found
Error relocating /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2: unsupported relocation type 37

seanhead avatar Mar 11 '25 23:03 seanhead