🚀 Install glibc 2.28 and libstdc++ on CentOS 7 for VS Code Remote-SSH compatibility
CentOS 7은 2024년 6월 30일에 **EOL(End of Life)**을 맞이했으며, 기본 glibc 버전(2.17)이 너무 낮아 최신 VS Code Remote-SSH 서버가 작동하지 않습니다.
이 프로젝트는 CentOS 7에서 glibc 2.28과 **libstdc++.so.6 (GLIBCXX_3.4.21+)**을 설치하여 VS Code Remote-SSH를 사용할 수 있게 해주는 자동화 스크립트입니다.
Could not resolve host: mirrorlist.centos.orgversion `GLIBC_2.28' not foundversion `GLIBCXX_3.4.21' not found
version `CXXABI_1.3.9' not found- ✅ 완전 자동화: 한 번의 실행으로 모든 설정 완료
- ✅ 멱등성 보장: 재실행 가능 (이미 설치된 구성 요소는 건너뜀)
- ✅ 안전성: 에러 처리 및 Fallback 로직 구현
- ✅ EOL 대응: vault.centos.org로 자동 전환
- ✅ 최신 라이브러리: glibc 2.28 + libstdc++ (gcc 9.3.0)
# GitHub에서 다운로드
wget https://raw.githubusercontent.com/YourBestDeveloper/vscode-remote-ssh-centos7/main/enable-remote-ssh-centos7.sh
# 또는 curl 사용
curl -O https://raw.githubusercontent.com/YourBestDeveloper/vscode-remote-ssh-centos7/main/enable-remote-ssh-centos7.sh# 실행 권한 부여
chmod +x enable-remote-ssh-centos7.sh
# root로 실행
sudo bash enable-remote-ssh-centos7.shVS Code에서 Remote-SSH로 연결하면 자동으로 작동합니다! 🎉
프로세서 성능에 따라 15-25분 정도 소요됩니다.
-
glibc 2.28
- 설치 위치:
/opt/glibc-2.28 - VS Code 서버가 요구하는 최신 glibc
- 설치 위치:
-
libstdc++.so.6 (gcc 9.3.0)
- 설치 위치:
/opt/rh/devtoolset-9/root/usr/lib64 - GLIBCXX_3.4.21+, CXXABI_1.3.9+ 지원
- 설치 위치:
-
devtoolset-9
- gcc 9.3.1
- make 4.2.1
- g++ 9.3.1
자동으로 다음 파일에 환경변수가 설정됩니다:
/etc/profile.d/vscode-glibc.sh/etc/environment
export VSCODE_SERVER_CUSTOM_GLIBC_LINKER=/opt/glibc-2.28/lib/ld-2.28.so
export VSCODE_SERVER_CUSTOM_GLIBC_PATH=/opt/glibc-2.28/lib:/opt/rh/devtoolset-9/root/usr/lib64:/usr/lib64:/lib64
export VSCODE_SERVER_PATCHELF_PATH=/bin/patchelf
export LD_LIBRARY_PATH=/opt/rh/devtoolset-9/root/usr/lib64:${LD_LIBRARY_PATH}1. Root 권한 체크
2. CentOS 7 EOL 처리 (vault.centos.org 전환)
3. EPEL 저장소 활성화
4. 필수 패키지 설치
4a. devtoolset-9 설치
4b. libstdc++.so.6 빌드
5. glibc 2.28 빌드
6. 환경변수 설정
7. 완료
# 환경변수 확인
cat /etc/profile.d/vscode-glibc.sh
# VS Code 서버 프로세스 종료 후 재시도
pkill -9 -f '.vscode-server'
# 스크립트 재실행
sudo bash enable-remote-ssh-centos7.sh# libstdc++ 파일 삭제 후 재실행
sudo rm -f /opt/rh/devtoolset-9/root/usr/lib64/libstdc++.so.6*
sudo bash enable-remote-ssh-centos7.sh
# glibc 삭제 후 재실행
sudo rm -rf /opt/glibc-2.28
sudo bash enable-remote-ssh-centos7.sh- 이 스크립트는 시스템 glibc를 교체하지 않습니다 (안전)
/opt/glibc-2.28에 별도로 설치됩니다- 기존 시스템 라이브러리는 영향받지 않습니다
- VS Code Remote-SSH 전용 설정입니다
Issue 및 Pull Request를 환영합니다!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT License - 자세한 내용은 LICENSE 파일을 참조하세요.
- Visual Studio Code - Remote-SSH 기능
- CentOS Project
- GNU libc
- GCC
CentOS 7 reached EOL (End of Life) on June 30, 2024, and its default glibc version (2.17) is too old for the latest VS Code Remote-SSH server.
This project provides an automated script to install glibc 2.28 and libstdc++.so.6 (GLIBCXX_3.4.21+) on CentOS 7, enabling VS Code Remote-SSH functionality.
Could not resolve host: mirrorlist.centos.orgversion `GLIBC_2.28' not foundversion `GLIBCXX_3.4.21' not found
version `CXXABI_1.3.9' not found- ✅ Fully Automated: One-command setup
- ✅ Idempotent: Safe to re-run (skips already installed components)
- ✅ Safe: Comprehensive error handling and fallback logic
- ✅ EOL Ready: Automatically switches to vault.centos.org
- ✅ Modern Libraries: glibc 2.28 + libstdc++ (gcc 9.3.0)
# Download from GitHub
wget https://raw.githubusercontent.com/YourBestDeveloper/vscode-remote-ssh-centos7/main/enable-remote-ssh-centos7.sh
# Or use curl
curl -O https://raw.githubusercontent.com/YourBestDeveloper/vscode-remote-ssh-centos7/main/enable-remote-ssh-centos7.sh# Make executable
chmod +x enable-remote-ssh-centos7.sh
# Run as root
sudo bash enable-remote-ssh-centos7.shConnect via Remote-SSH in VS Code - it will work automatically! 🎉
Approximately 15-25 minutes depending on your processor performance.
-
glibc 2.28
- Location:
/opt/glibc-2.28 - Required by VS Code server
- Location:
-
libstdc++.so.6 (gcc 9.3.0)
- Location:
/opt/rh/devtoolset-9/root/usr/lib64 - Supports GLIBCXX_3.4.21+, CXXABI_1.3.9+
- Location:
-
devtoolset-9
- gcc 9.3.1
- make 4.2.1
- g++ 9.3.1
Automatically configured in:
/etc/profile.d/vscode-glibc.sh/etc/environment
export VSCODE_SERVER_CUSTOM_GLIBC_LINKER=/opt/glibc-2.28/lib/ld-2.28.so
export VSCODE_SERVER_CUSTOM_GLIBC_PATH=/opt/glibc-2.28/lib:/opt/rh/devtoolset-9/root/usr/lib64:/usr/lib64:/lib64
export VSCODE_SERVER_PATCHELF_PATH=/bin/patchelf
export LD_LIBRARY_PATH=/opt/rh/devtoolset-9/root/usr/lib64:${LD_LIBRARY_PATH}# Check environment variables
cat /etc/profile.d/vscode-glibc.sh
# Kill VS Code server and retry
pkill -9 -f '.vscode-server'
# Re-run script
sudo bash enable-remote-ssh-centos7.sh# Rebuild libstdc++
sudo rm -f /opt/rh/devtoolset-9/root/usr/lib64/libstdc++.so.6*
sudo bash enable-remote-ssh-centos7.sh
# Rebuild glibc
sudo rm -rf /opt/glibc-2.28
sudo bash enable-remote-ssh-centos7.sh- This script does NOT replace system glibc (safe)
- Installs separately in
/opt/glibc-2.28 - Existing system libraries remain untouched
- Specific to VS Code Remote-SSH
Issues and Pull Requests are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT License - see LICENSE file for details.
- Visual Studio Code - Remote-SSH feature
- CentOS Project
- GNU libc
- GCC