본문 바로가기
서버/리눅스 서버

Chrome Remote Desktop Headless 설치하기

by ㅋㅋ잠자 2019. 11. 18.
반응형

안녕하세요? 크롬 원격 데스크톱 기능을 headless 상태에서 Chrome 브라우저를 설치하지 않고 사용하는 방법에 대해서 기술하고 있습니다.





1. Chrome Remote Desktop 설치하기


https://remotedesktop.google.com/headless/


상기 경로로 이동하면 설치하는 파일을 받을 수 있습니다.


그럼 Headless 로 작동하고 있는 debian10 에 설치를 해보겠습니다. (amd64)


root@openmediavault:~# wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb

--2019-11-18 18:48:54--  https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb

Resolving dl.google.com (dl.google.com)... 216.58.197.206, 2404:6800:4004:800::200e

Connecting to dl.google.com (dl.google.com)|216.58.197.206|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 26739296 (26M) [application/x-debian-package]

Saving to: ‘chrome-remote-desktop_current_amd64.deb’


   chrome-remote-desktop_cur  78%[===================================>           ]  19.99M  7.72MB/s


root@openmediavault:~# dpkg -i chrome-remote-desktop_current_amd64.deb 

Selecting previously unselected package chrome-remote-desktop.

(Reading database ... 73592 files and directories currently installed.)

Preparing to unpack chrome-remote-desktop_current_amd64.deb ...

Unpacking chrome-remote-desktop (79.0.3945.10) ...

dpkg: dependency problems prevent configuration of chrome-remote-desktop:

 chrome-remote-desktop depends on xvfb; however:

  Package xvfb is not installed.

 chrome-remote-desktop depends on xbase-clients; however:

  Package xbase-clients is not installed.

 chrome-remote-desktop depends on python-psutil; however:

  Package python-psutil is not installed.

 chrome-remote-desktop depends on libgtk-3-0 (>= 3.9.10); however:

  Package libgtk-3-0 is not installed.

 chrome-remote-desktop depends on libxcomposite1 (>= 1:0.3-1); however:

  Package libxcomposite1 is not installed.

 chrome-remote-desktop depends on libxi6; however:

  Package libxi6 is not installed.

 chrome-remote-desktop depends on libxss1; however:

  Package libxss1 is not installed.

 chrome-remote-desktop depends on libxtst6; however:

  Package libxtst6 is not installed.


dpkg: error processing package chrome-remote-desktop (--install):

 dependency problems - leaving unconfigured

Processing triggers for systemd (241-7~deb10u1) ...

Errors were encountered while processing:

 chrome-remote-desktop



root@openmediavault:~# apt-get -f install

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Correcting dependencies... Done

The following additional packages will be installed:

  adwaita-icon-theme gtk-update-icon-cache hicolor-icon-theme libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data

  libatspi2.0-0 libcolord2 libfontenc1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgtk-3-0 libgtk-3-common

  libice6 liblcms2-2 librest-0.7-0 librsvg2-2 librsvg2-common libsm6 libsoup-gnome2.4-1 libsoup2.4-1 libxaw7

  libxcb-shape0 libxcomposite1 libxcursor1 libxfont2 libxft2 libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxmu6

  libxss1 libxt6 libxtst6 libxxf86dga1 python-psutil shared-mime-info x11-apps x11-common x11-session-utils

  x11-utils x11-xkb-utils x11-xserver-utils xbase-clients xinit xserver-common xvfb

Suggested packages:

  colord gvfs liblcms2-utils librsvg2-bin python-psutil-doc mesa-utils nickle cairo-5c xorg-docs-core

  x11-xfs-utils

Recommended packages:

  at-spi2-core libgdk-pixbuf2.0-bin libgtk-3-bin xbitmaps xterm | x-session-manager | x-window-manager

  | x-terminal-emulator xfonts-base

The following NEW packages will be installed:

  adwaita-icon-theme gtk-update-icon-cache hicolor-icon-theme libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data

  libatspi2.0-0 libcolord2 libfontenc1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgtk-3-0 libgtk-3-common

  libice6 liblcms2-2 librest-0.7-0 librsvg2-2 librsvg2-common libsm6 libsoup-gnome2.4-1 libsoup2.4-1 libxaw7

  libxcb-shape0 libxcomposite1 libxcursor1 libxfont2 libxft2 libxi6 libxinerama1 libxkbcommon0 libxkbfile1 libxmu6

  libxss1 libxt6 libxtst6 libxxf86dga1 python-psutil shared-mime-info x11-apps x11-common x11-session-utils

  x11-utils x11-xkb-utils x11-xserver-utils xbase-clients xinit xserver-common xvfb

0 upgraded, 48 newly installed, 0 to remove and 72 not upgraded.

1 not fully installed or removed.

Need to get 29.8 MB of archives.

After this operation, 95.7 MB of additional disk space will be used.

Do you want to continue? [Y/n] 


초기에 패키지 단독 설치시, 의존성 에러가 나지만, 의존성을 해결하여 설치가 가능합니다.





2. Chrome Remote Desktop 서비스 실행하기


상기 1번 URL 에서 다음으로 넘어가게 되면 계정을 선택하고 실행할 명령어가 나옵니다.




Debian Linux 를 복사하여 실행해 보겠습니다.


일단 root 계정으로 실행이 되지 않고 있습니다. 그렇기 때문에 일반 계정을 생성하여 구동을 해봅니다.


root@openmediavault:~# adduser djjproject

Adding user `djjproject' ...

Adding new group `djjproject' (1000) ...

Adding new user `djjproject' (1001) with group `djjproject' ...

Creating home directory `/home/djjproject' ...

Copying files from `/etc/skel' ...

New password: 

Retype new password: 

passwd: password updated successfully

Changing the user information for djjproject

Enter the new value, or press ENTER for the default

Full Name []: 

Room Number []: 

Work Phone []: 

Home Phone []: 

Other []: 

Is the information correct? [Y/n] 


root@openmediavault:~# adduser djjproject sudo

Adding user `djjproject' to group `sudo' ...

Adding user djjproject to group sudo

Done.

root@openmediavault:~# su djjproject

djjproject@openmediavault:/root$ Refusing to run /opt/google/chrome-remote-desktop/start-host as root.^C

djjproject@openmediavault:/root$ ^C

djjproject@openmediavault:/root$ DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="-----------------------------------------------------------------------------------------------------------------------" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=


Enter a name for this computer: DJJSERVER

Enter a PIN of at least six digits: 

Enter the same PIN again: 

[sudo] password for djjproject: 


[1118/185534.983913:INFO:daemon_controller_delegate_linux.cc(99)] 

We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:


    #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.


Adding user djjproject to group chrome-remote-desktop


[1118/185539.582457:INFO:daemon_controller_delegate_linux.cc(99)] [1118/185535.079659:INFO:remoting_user_session.cc(733)] Daemon process started in the background, logging to '/tmp/chrome_remote_desktop_20191118_185535_dV2wsX'

Using host_id: ---------------------------------------------------------

Launching X server and X session.

Starting Xvfb on display :20

X server is active.

Launching X session: ['/opt/google/chrome-remote-desktop/chrome-remote-desktop-host', '--type=xsession_chooser']

Launching host process

['/opt/google/chrome-remote-desktop/chrome-remote-desktop-host', '--host-config=-', '--audio-pipe-name=/home/djjproject/.config/chrome-remote-desktop/pulseaudio#f1ed12aacb/fifo_output', '--server-supports-exact-resize', '--ssh-auth-sockname=/tmp/chromoting.djjproject.ssh_auth_sock', '--signal-parent']

wait() returned (30376,0)

Host ready to receive connections.

Log file: /tmp/chrome_remote_desktop_20191118_185535_dV2wsX


djjproject@openmediavault:/root$ 


정상적으로 실행이 되었으며, WebUI 로 이동해 보면 아래와 같이 떠 있습니다.



다만 연결하니 시작할 세션이 없다고 그럽니다.







3. 뭐라도 뜨게 만들어보자.. 


하기 링크를 참조하면 아무것도 없을 때, x-terminal-emulator 를 실행한다고 되어 있습니다.


https://wiki.debian.org/Xsession


root@openmediavault:~# apt install x-terminal-emulator

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Package x-terminal-emulator is a virtual package provided by:

  xterm 344-1

  xiterm+thai 1.10-2

  xfce4-terminal 0.8.7.4-2

  tilix 1.8.9-1

  termit 3.0-1+b1

  terminology 1.3.2-1

  terminator 1.91-4

  stterm 0.8.2-1

  sakura 3.6.0-3

  rxvt-unicode 9.22-6

  qterminal 0.14.1-1

  pterm 0.70-6

  mlterm-tiny 3.8.6-2

  mlterm 3.8.6-2

  mate-terminal 1.20.2-2

  lxterminal 0.3.2-1

  lilyterm 0.9.9.4+git20150208.f600c0-5

  konsole 4:18.04.0-1

  kitty 0.13.3-1

  gnome-terminal 3.30.2-2

  eterm 0.9.6-5

  deepin-terminal 3.2.1.1+ds1-1

You should explicitly select one to install.


흠.. 상기 패키지 중에서 설치할 만한게.. 일단 이 다음 부터 xfce4 를 설치할 예정이라 xfce4-terminal 을 설치해 보겠습니다.


root@openmediavault:~# apt install xfce4-terminal

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following additional packages will be installed:

  exo-utils libdbus-glib-1-2 libexo-2-0 libexo-common libexo-helpers libstartup-notification0 libutempter0

  libvte-2.91-0 libvte-2.91-common libxcb-util0 libxfce4ui-2-0 libxfce4ui-common libxfce4util-common libxfce4util7

  libxfconf-0-2 xfconf

Suggested packages:

  devhelp

Recommended packages:

  liburi-perl libxfce4util-bin

The following NEW packages will be installed:

  exo-utils libdbus-glib-1-2 libexo-2-0 libexo-common libexo-helpers libstartup-notification0 libutempter0

  libvte-2.91-0 libvte-2.91-common libxcb-util0 libxfce4ui-2-0 libxfce4ui-common libxfce4util-common libxfce4util7

  libxfconf-0-2 xfce4-terminal xfconf

0 upgraded, 17 newly installed, 0 to remove and 72 not upgraded.

Need to get 3484 kB of archives.

After this operation, 9018 kB of additional disk space will be used.

Do you want to continue? [Y/n]   


그러면 아래와 같이 화면이 뜨기 시작합니다.






4. xfce4 설치하기


터미널만 달랑 뜨는게 불쌍하여 데스크톱 매니저를 설치해봅니다.


root@openmediavault:~# apt install xfce4

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following additional packages will be installed:

  desktop-file-utils gtk2-engines-xfce libasyncns0 libexif12 libexo-1-0 libflac8 libgarcon-1-0 libgarcon-common

  libgtk2.0-0 libgtk2.0-common libkeybinder-3.0-0 libnotify4 libogg0 libpulse-mainloop-glib0 libpulse0 libsndfile1

  libthunarx-3-0 libupower-glib3 libvorbis0a libvorbisenc2 libwnck-common libwnck22 libxfce4panel-2.0-4

  libxfce4ui-1-0 libxfce4ui-utils libxklavier16 libxres1 thunar thunar-data xfce4-appfinder xfce4-panel

  xfce4-pulseaudio-plugin xfce4-session xfce4-settings xfdesktop4 xfdesktop4-data xfwm4

Suggested packages:

  gvfs pulseaudio thunar-archive-plugin thunar-media-tags-plugin gtk3-engines-xfce xfce4-goodies

  xfce4-power-manager fortunes-mod menu xfwm4-themes

Recommended packages:

  liburi-perl libgail-common libgtk2.0-bin notification-daemon upower gvfs policykit-1-gnome | polkit-1-auth-agent

  thunar-volman tumbler xdg-user-dirs desktop-base tango-icon-theme xfce4-notifyd xorg pavucontrol pulseaudio

  dbus-x11 light-locker

The following NEW packages will be installed:

  desktop-file-utils gtk2-engines-xfce libasyncns0 libexif12 libexo-1-0 libflac8 libgarcon-1-0 libgarcon-common

  libgtk2.0-0 libgtk2.0-common libkeybinder-3.0-0 libnotify4 libogg0 libpulse-mainloop-glib0 libpulse0 libsndfile1

  libthunarx-3-0 libupower-glib3 libvorbis0a libvorbisenc2 libwnck-common libwnck22 libxfce4panel-2.0-4

  libxfce4ui-1-0 libxfce4ui-utils libxklavier16 libxres1 thunar thunar-data xfce4 xfce4-appfinder xfce4-panel

  xfce4-pulseaudio-plugin xfce4-session xfce4-settings xfdesktop4 xfdesktop4-data xfwm4

0 upgraded, 38 newly installed, 0 to remove and 72 not upgraded.

Need to get 14.2 MB of archives.

After this operation, 62.2 MB of additional disk space will be used.

Do you want to continue? [Y/n]


dbus-launch 에러가 발생함으로 아래의 패키지를 설치하여 해결합니다.


root@openmediavault:/home/djjproject# apt install dbus-x11

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following NEW packages will be installed:

  dbus-x11

0 upgraded, 1 newly installed, 0 to remove and 72 not upgraded.

Need to get 106 kB of archives.

After this operation, 160 kB of additional disk space will be used.

Get:1 http://debian-archive.trafficmanager.net/debian buster/main amd64 dbus-x11 amd64 1.12.16-1 [106 kB]

Fetched 106 kB in 0s (432 kB/s) 

Selecting previously unselected package dbus-x11.

(Reading database ... 83964 files and directories currently installed.)

Preparing to unpack .../dbus-x11_1.12.16-1_amd64.deb ...

Unpacking dbus-x11 (1.12.16-1) ...

Setting up dbus-x11 (1.12.16-1) ...

Processing triggers for man-db (2.8.5-2) ...

root@openmediavault:/home/djjproject# service dbus restart


이후 연결하게 되면 아래와 같이 잘 작동하게 됩니다.






5. 마치며..


chrome remote 에서 한곳에 관리하기가 매우 편리합니다.


이렇게 헤드리스 서버에 설치하여 동작시켜 편리한 삶을 누리시길 바랍니다... ㅎㅎㅎ


감사합니다.







반응형

댓글