이것저것

vscode remote ssh 서버 수동설치

ForceCore 2022. 11. 14. 11:22

https://stackoverflow.com/questions/56671520/how-can-i-install-vscode-server-in-linux-offline

 

How can I install vscode-server in linux offline

I am trying to install VScode remote-ssh extensions, but my remote host could not connect to the Internet,so there is no way to download software is needed. So I got some error message like that: ...

stackoverflow.com

 

vscode-server-linux-x64.tar.gz

여러가지 이유로 이걸 못 다운로드 받아서 문제가 생기곤 한다.

1. remote쪽이 망분리가 되어있다.

2. 회사 내 모든 컴퓨터들이 한 개의 public ip로 보여서 MS의 CDN이 스팸으로 간주하는 바람에 다운로드 자체가 안 된다.

 

이럴땐 remote쪽에 접속해서 ps -eaf | grep weget 을 보면 어떤 파일을 받으려고 하는지 알 수 있다.

혹은 

curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

로 다운로드 받아도 되는데...

 

수단과 방법을 가리지 않고 다운로드를 받은 뒤에, 손으로 압축을 풀고 파일 이름이 "0"인 빈 파일을 생성하면 된다.

 

 

 

아래 내용은 파일을 어디에서 받아서 어디에 압축을 풀어야 하는지, 위 설명에서 빠진 것까지 다 포함하는 내용이다:

commit_id=f06011ac164ae4dc8e753a3fe7f9549844d15e35

# Download url is: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

mkdir -p ~/.vscode-server/bin/${commit_id}
# assume that you upload vscode-server-linux-x64.tar.gz to /tmp dir
tar zxvf /tmp/vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id} --strip 1
touch ~/.vscode-server/bin/${commit_id}/0

맨 아랫줄의 touch 명령어대로 commit_id 폴더에다가 만들면 된다.

 

커밋번호 (위 명령들에서 commit_id) 알아내는 법:

$ code --version
1.73.1
6261075646f055b99068d3688932416f2346dd3b
x64

이렇게 알아낸다.