[Lab] vscode remote ssh 무한로딩(feat. libstdc, ibstdc)

츄르츄르츄츄·2024년 8월 15일

🚀VScode에서 Remote ssh를 사용할 때 발생하는 에러를 해결해 보자

환경

local: Windows 10
remote: Ubuntu 22.04
접속: VS Code의 remote-ssh를 사용

상황

  1. remote-ssh로 remote 서버에 접속하려 했다.
  2. 무한로딩이 걸리고, 비밀번호 재 입력을 요구했다.
  3. 이렇듯, remote 서버는 local에서 접속이 안되어 로그를 확인하기 힘들었다.
  4. Putty를 사용해서 remote 서버에 접속하였다.
  5. /root/.vscode-server 폴더에 이름복잡한.log 파일을 열어보았다.
  6. 이름복잡한.log 파일에서 아래와 같은 메시지가 나왔다.
[2038-01-19] info Downloading Visual Studio Code server -> vscode-server-aaaa.tar.gz
[2038-01-19] error Error installing server: error checking server integrity: failed to run command "/root/.vscode-server/aaaa --version" (code 127): Error loading shared library libstdc++.so.6: No such file or directory (needed by /root/.vscode-server/aaaa/node)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /root/.vscode-server/aaaaa/node)
Error relocating /root/.vscode-server/aaaaa/node: aaaaa: symbol not found
  1. libgcc_s.so.1, ibstdc++.so.6 No such file or directory 에러이다.
  2. 이 라이브러리의 설명은 다음과 같다.
    libstdc++.so.6: This is the GNU Standard C++ Library, required by many applications built with C++.
    libgcc_s.so.1: This is part of the GCC runtime library, used by applications compiled with GCC.

🕵해결방법: GPT야 도와줘

1. Putty를 사용해 remote에 접근한다.

remote 서버에 VS code로는 접속이 안되는 만큼 putty를 사용해서 접속한다.
참고->putty로 Remote 서버에 연결하기(Proxy jump는 미사용시 무시)

2. 설치를 해보자

  1. 로그에서 없다는 것 먼저 설치해 보자
sudo apt update
sudo apt install libstdc++6 libgcc1
  1. 잘 설치 되었는지 확인
ldconfig -p | grep libstdc++.so.6
ldconfig -p | grep libgcc_s.so.1
  1. 필자는 여기에서 /sbin/ldconfig.real: not found가 나왔다.
    이러면 libc-bin를 설치해보자. (아니면 통과)
sudo apt update
sudo apt install --reinstall libc-bin
  1. idconifg에서 에러가 나오는지 확인
sudo ldconfig
  1. 이상없으면 2단계를 다시 시도
ldconfig -p | grep libstdc++.so.6
ldconfig -p | grep libgcc_s.so.1


이상없이 뜨면 완료

3. .vscode-server삭제 (Optional)

안 해도 될 것 같긴하다.
1. /.vscode-server의 상위 폴더로 이동
2. vscode 폴더를 삭제한다. 데이터 날라감 주의

rm-rf .vscode-server 

4. vscode remote-ssh 재접속

  1. remote-ssh에서 재접속을 실행한다.
  2. 성공👌

이래도 안되면....😣

정 안되면 이거라도

sudo apt install libc6
sudo apt install musl
profile
나는야 이빨요정

0개의 댓글