본문 바로가기
Cloud/Google Cloud Platform

GCP(Google Cloud) 원격 데스크 톱(RDP) 연결: Linux 용 Chrome RDP

by Kibua20 2020. 7. 30.

본 포스팅은 GCP에 만들어 놓은 가상 PC (VM) 원격 데스크 탑을 연결하는 방법을 소개합니다. 본 포스팅은 Google 공식 가이드를 참조하였으면, 사용된 GCP는 f1-micro instance 등급이며, us-west-b region에 설치된  VM입니다.  원격 데스크 톱 설치는 가능하지만, Network 속도의 문제인지 VM 성능 문제인지 확실치는 않지만 반응 속도가 너무 느립니다.  평생 무료 등급 (f1-micro instance) 등급을 사용하는 분은 원격 데스크 톱 사용은 포기하고 터미널로만 접속하는 것이 나을 것 같고, 스펙 좋은 GCP 서버는 시도해볼 필요가 있습니다.  

 

원격 서버에 Chrome remote desktop을 설치하는 과정은 아래와 같습니다. 

  • VM 인스턴스에서 Chrome 원격 데스크톱을 설치하고 구성합니다.
  • VM 인스턴스에서 X Window System 데스크톱 환경을 설정합니다.
  • 로컬 컴퓨터에서 VM 인스턴스의 데스크톱 환경으로 연결합니다..

원격 서버에 Chrome  Remote Desktop설치

VM 인스턴스에서 Chrome 원격 데스크톱을 설치하고 구성합니다. 

 

$ wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb

$ sudo dpkg --install chrome-remote-desktop_current_amd64.deb

 

# dependency 모듈을 설치 

$ sudo apt install --assume-yes --fix-broken

 

 

chrome-remote-desktop_current_amd64.deb 설치 결과

 

 

원격 서버에 X Windows System 데스크톱 환경 설치

VM 인스턴스에서 X Window System 데스크톱 환경을 설정합니다.  Xfce는 상대적으로 느린 네트워크에서도 원격 연결이 제대로 이루어지는 간단하고 간편한 데스크톱 환경을 설정한다고 합니다. 

 

 

$ sudo DEBIAN_FRONTEND=noninteractive  apt install --assume-yes xfce4 desktop-base

 

noninteractive 의미:  You use this mode when you need zero interaction while installing or upgrading the system via apt. It accepts the default answer for all questions. It might mail an error message to the root user, but that’s it all. Otherwise, it is totally silent and humble, a perfect frontend for automatic installs. One can use such mode in Dockerfile, shell scripts, cloud-init script, and more.

 

# 설정 파일 추가

$ sudo bash -c 'echo "exec /etc/X11/Xsession /usr/bin/xfce4-session" > /etc/chrome-remote-desktop-session'

 

# 입력을 받기 못하기 때문에 xscreensaver 설치

$ sudo apt install --assume-yes xscreensaver

 

# chrome-remote-desktop 유저 그룹에 ID 추가 

$ sudo usermod --G chrome-remote-desktop $USER

 

# VM logout
$ logout

 

 

 

필요 시 chrome을 설치합니다. 

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo dpkg --install google-chrome-stable_current_amd64.deb
$ sudo apt install --assume-yes --fix-broken



원격 서버의 Chrome 원격 데스크톱 서비스 구성 및 시작

원격 GCP 서버는 모니터가 없기 때문에 로컬 PC에서도 Chrome remote desktop을 설정해야 합니다.  로컬 컴퓨터에서 Chrome 브라우저를 사용하여 아래 사이트에서 명령어를 복사해서 원격 GCP 서버에 Chrome 원격 데스크톱 명령어를 입력해야 합니다. 

 

https://remotedesktop.google.com/headless

 

 

원격 서버의 Chrome 원격 데스크톱 서비스 구성 및 시작

 

원격 서버의 Chrome desktop 서비스 구성 및 Pin 번호를 입력합니다.  원격 서버에서 입력하는 값으로 로컬 PC에서 접속할 때 패스워드로 사용됩니다.

 

원격 서버의 Chrome 원격 데스크톱 서비스 구성 및 시작

 



로컬 PC에서 VM 인스턴스에 연결

https://remotedesktop.google.com/access/ 사이트 접속해서 원격 액세스를 실행하고,  원격 서버에 설정한 PIN code를 입력합니다. 

 

로컬 PC에서 원격 서버의 PIN 번호 입력

 

원격 서버에 접속면 아래와 같은 화면이 나옵니다. 

 

원격 서버에 Chrome remote Desktop으로 연결한 화면

 

 

관련 글

[개발환경/Google Cloud Platform] - GCP (Google Cloud) 하드 디스크 추가하기 (영구 디스크는 30GB까지 무료)

[개발환경/Google Cloud Platform] - GCP (Google Cloud) 방화벽 설정: 프로토콜과 포트를 사용 허용 또는 거부하기

[개발환경/Google Cloud Platform] - Google Cloud Platform을 활용하여 평생 '무료' PC 만들기

[모바일 SW 개발/REST API] - Service Account(JWT)을 활용한 Google Calendar API 사용

[모바일 SW 개발/REST API] - 우분투 20.04에서 Web 서버 설치 방법 (apache2, tomcat9)

[모바일 SW 개발/REST API] - Google Gmail API 사용 방법 (1) - Sample code

[개발환경] - [실패 사례] gcc 버전이 낮은 상용 리눅스 서버에서 프로그램 설치 시 GLIBCXX' not found 에러

[개발환경] - 윈도우용 MobaXterm - SSH 및 X-Server 지원

[개발환경] - WSL 2.0 Global configuration (.wslconfig) 을 통한 성능 향상

[모바일 SW 개발/Android] - Android 11 기능 소개

[개발환경] - [Tips] Ubuntu 20.04 에서 swap file 늘리기

[개발환경] - 리눅스 시스템 정보 확인 방법 (우분투 버전, gcc 버전, libc 버전)

[개발환경] - 우분투 터미널에 Putty 스타일 Copy&Paste 적용 (Terminator)




댓글