우분투에 구글 원격 데스크톱 설치 및 오류 해결 방법

흔적 저장소·2023년 6월 4일
0

구글 원격 데스크톱 설치

  • 크롬 설치 [1]
sudo apt update
sudo apt install wget -y
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
cd ~/Downloads
sudo dpkg -i ./google-chrome-stable_current_amd64.deb
sudo dpkg -i ~/Downloads/.deb

문제 해결 방법

원격 엑세스 설정이 완료되지 않는 경우

  • 폴더 생성
mkdir ~/.config/chrome-remote-desktop

검은 화면 나타나는 경우

사용자 선택 화면 표시되는 경우

  • 크롬의 GPU 가속 설정을 사용하지 않음으로 변경
    • settings - system - disable hardware aeceleration
  • chrome-remote-desktop 그룹에 사용자 ID 추가
    • 오류 발생하지만 무시
sudo usermod -a -G chrome-remote-desktop <username>
  • chrome remote desktop 정지
/opt/google/chrome-remote-desktop/chrome-remote-desktop --stop
  • chrome remote desktop 설정 파일 백업
sudo cp /opt/google/chrome-remote-desktop/chrome-remote-desktop /opt/google/chrome-remote-desktop/chrome-remote-desktop.orig
  • 현재 설정된 DISPLAY 값 확인
echo $DISPLAY
  • 파일 열기
    • 파일 편집 방법은 vim 등 편한 툴로 진행하면 됨
      • GUI가 제공되는 환경에서는 gedit으로 편집하는 방법을 추천함
sudo gedit /opt/google/chrome-remote-desktop/chrome-remote-desktop
  • 파일 내 코드 수정 후 저장
        
# echo $DISPLAY 입력 후 나오는 숫자를 아래 변수에 입력
FIRST_X_DISPLAY_NUMBER = 0
        
...
        
@staticmethod
def get_unused_display_number():
"""Return a candidate display number for which there is currently no
	X Server lock file"""
	display = FIRST_X_DISPLAY_NUMBER
	# 아래 두 줄 주석처리
	# while os.path.exists(X_LOCK_FILE_TEMPLATE % display):
	#   display += 1
	return display
        
...
        
def launch_session(self, server_args, backoff_time):
"""Launches process required for session and records the backoff time
	for inhibitors so that process restarts are not attempted again until
	that time has passed."""
	logging.info("Setting up and launching session")
	self._init_child_env()
	self.setup_audio()
	self._setup_gnubby()
	# 아래 내용 주석처리 
	# self._launch_server(server_args)
	# if not self._launch_pre_session():
	#  # If there was no pre-session script, launch the session immediately.
	#  self.launch_desktop_session()
	# self.server_inhibitor.record_started(MINIMUM_PROCESS_LIFETIME,
	#                                  backoff_time)
	# self.session_inhibitor.record_started(MINIMUM_PROCESS_LIFETIME,
	#                                 backoff_time)
	# 두 줄 추가
	display = self.get_unused_display_number()
	self.child_env["DISPLAY"] = ":%d" % display
  • chrome remote desktop 시작
/opt/google/chrome-remote-desktop/chrome-remote-desktop --start
  • 크롬에서 chrome remote desktop 실행 및 사용

우분투 22.04 LTS 버전에서 검은 화면만 표시되는 경우

  • 원인
    • 우분투 20.04까지는 기본 GUI 출력 방식은 X11임
    • 우분투 22.04 LTS에서는 Wayland 방식이 기본 값임
      • chrome remote desktop은 X11 방식을 사용하기 때문에 GUI 출력 방식을 Wayland에서 X11로 변경해야 함
  • GUI 출력 방식 변경 방법
    • 변경 방법
      1. 시작 화면에서 변경
        • 시작 화면 우측 하단에 아이콘 확인
        • GUI 출력 방식 선택
      2. /etc/gdm3/custom.conf 수정 [2]
      • WaylandEnable=false로 변경

[1] https://webnautes.tistory.com/1691
[2] https://askubuntu.com/questions/1410256/how-do-i-use-the-x-window-manager-instead-of-wayland-on-ubuntu-22-04

profile
더 나은 결과물을 위한 작은 공간

1개의 댓글

comment-user-thumbnail
2023년 12월 26일

This guy is correct

답글 달기