Using the Visual Studio Code Remote Tunnels extension (Linux Host)

2024. 9. 6. 18:33카테고리 없음

https://code.visualstudio.com/docs/remote/tunnels

 

Remote Tunnels

Using the Visual Studio Code Remote Tunnels extension

code.visualstudio.com

1. VSCode실행 후, SSH로 디바이스(호스트) 접속 후, 터미널에서 아래 명령어를 입력해 다운로드 & 압축 풀기
(Jetson Device와 같은 경우에는 " https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-arm64"로 변경하여 사용)

curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz

tar -xf vscode_cli.tar.gz

 

2. GitHub 로그인

아래 명령어를 입력하면 GitHub 로그인을 위한 링크가  출력

./code tunnel

 

 

링크 예) https://github.com/login/device

 

3. 별칭 설정

"What would you like to call this machine?"라는 메시지가 출력되며, 별칭을 설정할 수 있음.

(나중에 접속 시 구분하기 위한 별칭)

 

4. Tunnel 서비스 실행

Ctrl-C를 눌러 이전 중단한 뒤, 아래 명령어으로 서비스 실행

./code tunnel service install

 

5. 접속하는 디바이스(Guest)에서 VSCode실행 후 Extension에서 "Remote - Tunnels" 설치

 

6. Vscode에서 "Ctrl + Shift + p"를 입력 후, "connect to tunnel" 입력하면 원하는 호스트 디바이스에 접속 가능.