RaspberryPi에 x11vnc를 도입하는 단계
목적
지금까지는 TightVNC(tightvncserver)를 사용하고 있었다.
그러나 opencv-python
를 사용하여,
실시간으로 카메라 미리보기를 보려고 하면,
다음과 같은 오류가 발생했습니다.
GdkGLExt-WARNING **: Window system doesn't support OpenGL.
「TightVNC는 기동중의 데스크탑과는 다른 데스크탑을 작성해 접속하는 것」이라고 하는 기술을 보았으므로, 그렇지 않다 x11vnc
를 인스톨 해 본다.
설치
$ sudo apt-get install x11vnc
연결할 때 ~/nohup.out
권한이 없으면 Permission Denied 오류가 발생합니다.
따라서 권한을 부여한다.
$ sudo chmod 666 ~/nohup.out
실행
우선 접속시의 패스워드를 설정한다.
$ x11vnc -storepasswd
대략의 기사로 기동시에 -create
옵션을 붙이지 않고 실행하고 있었지만,
내 환경에서 왜 다음과 같은 오류가 발생했습니다.
$ x11vnc -usepw -forever
.
.
.
18/09/2017 00:21:56 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Some tips and guidelines:
** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).
** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.
** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:
- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.
** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:
-create
옵션을 붙임으로써 치료했다.
x11vnc -usepw -forever -create
18/09/2017 10:07:21 -usepw: found /home/pi/.vnc/passwd
18/09/2017 10:07:21 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 9992
18/09/2017 10:07:21
18/09/2017 10:07:21 wait_for_client: WAIT:cmd=FINDCREATEDISPLAY-Xvfb
18/09/2017 10:07:21
18/09/2017 10:07:21 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/2560
18/09/2017 10:07:21
18/09/2017 10:07:21 Autoprobing TCP port
18/09/2017 10:07:21 Autoprobing selected TCP port 5900
18/09/2017 10:07:21 Autoprobing TCP6 port
18/09/2017 10:07:21 Autoprobing selected TCP6 port 5900
18/09/2017 10:07:21 listen6: bind: Address already in use
18/09/2017 10:07:21 Not listening on IPv6 interface.
18/09/2017 10:07:21
The VNC desktop is: raspberrypi:0
PORT=5900
그건 그렇고,
GdkGLExt-WARNING **: Window system doesn't support OpenGL.
$ sudo apt-get install x11vnc
연결할 때
~/nohup.out
권한이 없으면 Permission Denied 오류가 발생합니다.따라서 권한을 부여한다.
$ sudo chmod 666 ~/nohup.out
실행
우선 접속시의 패스워드를 설정한다.
$ x11vnc -storepasswd
대략의 기사로 기동시에 -create
옵션을 붙이지 않고 실행하고 있었지만,
내 환경에서 왜 다음과 같은 오류가 발생했습니다.
$ x11vnc -usepw -forever
.
.
.
18/09/2017 00:21:56 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Some tips and guidelines:
** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).
** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.
** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:
- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.
** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:
-create
옵션을 붙임으로써 치료했다.
x11vnc -usepw -forever -create
18/09/2017 10:07:21 -usepw: found /home/pi/.vnc/passwd
18/09/2017 10:07:21 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 9992
18/09/2017 10:07:21
18/09/2017 10:07:21 wait_for_client: WAIT:cmd=FINDCREATEDISPLAY-Xvfb
18/09/2017 10:07:21
18/09/2017 10:07:21 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/2560
18/09/2017 10:07:21
18/09/2017 10:07:21 Autoprobing TCP port
18/09/2017 10:07:21 Autoprobing selected TCP port 5900
18/09/2017 10:07:21 Autoprobing TCP6 port
18/09/2017 10:07:21 Autoprobing selected TCP6 port 5900
18/09/2017 10:07:21 listen6: bind: Address already in use
18/09/2017 10:07:21 Not listening on IPv6 interface.
18/09/2017 10:07:21
The VNC desktop is: raspberrypi:0
PORT=5900
그건 그렇고,
$ x11vnc -storepasswd
$ x11vnc -usepw -forever
.
.
.
18/09/2017 00:21:56 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Some tips and guidelines:
** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).
** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.
** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:
- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.
** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:
x11vnc -usepw -forever -create
18/09/2017 10:07:21 -usepw: found /home/pi/.vnc/passwd
18/09/2017 10:07:21 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 9992
18/09/2017 10:07:21
18/09/2017 10:07:21 wait_for_client: WAIT:cmd=FINDCREATEDISPLAY-Xvfb
18/09/2017 10:07:21
18/09/2017 10:07:21 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/2560
18/09/2017 10:07:21
18/09/2017 10:07:21 Autoprobing TCP port
18/09/2017 10:07:21 Autoprobing selected TCP port 5900
18/09/2017 10:07:21 Autoprobing TCP6 port
18/09/2017 10:07:21 Autoprobing selected TCP6 port 5900
18/09/2017 10:07:21 listen6: bind: Address already in use
18/09/2017 10:07:21 Not listening on IPv6 interface.
18/09/2017 10:07:21
The VNC desktop is: raspberrypi:0
PORT=5900
-usepw
는 암호를 사용하여 연결하는 옵션 -forever
는 처음에 연결된 사용자가 연결을 끊더라도 x11vnc가 종료되지 않도록하는 옵션입니다.자동 시작 설정
Raspberry Pi를 시작할 때마다 x11vnc를 시작하는 것은 번거롭기 때문에,
자동 기동 설정도 해 둔다.
TightVNC의 자동 기동 설정하고 있었으므로 삭제.
$ rm ~/.config/autostart/tightvnc.desktop
x11vnc 자동 시작 설정 추가.
$ sudo vi ~/.config/autostart/x11vnc.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=X11VNC
Exec=x11vnc -usepw -forever -create
StartupNortify=false
Terminal=false
Hidden=false
다시 시작합니다.
$ sudo reboot
연결 확인
Raspberry Pi를 다시 시작한 후 시작이 완료될 때까지 약간의 시간을 두고,
수중 Mac에서 Finder => 移動 => サーバへ接続
vnc://(Raspberry PiのIPアドレス):5900
를 입력하고 接続
버튼을 누릅니다.
음. . . 뭔가 검은.
아, Raspberry Pi의 기동 설정을 CLI
로 하고 있었다.
$ sudo raspi-config
Boot Options => Desktop / CLI => Desktop Autologin
선택.
재기동을 촉구해 오므로, 재기동한다.
시간을 두고 Mac으로 다시 연결하면 ...
이 환경에서는 Window system doesn't support OpenGL.
도 나오지 않게 되었다.
요약
$ rm ~/.config/autostart/tightvnc.desktop
$ sudo vi ~/.config/autostart/x11vnc.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=X11VNC
Exec=x11vnc -usepw -forever -create
StartupNortify=false
Terminal=false
Hidden=false
$ sudo reboot
Raspberry Pi를 다시 시작한 후 시작이 완료될 때까지 약간의 시간을 두고,
수중 Mac에서
Finder => 移動 => サーバへ接続
vnc://(Raspberry PiのIPアドレス):5900
를 입력하고
接続
버튼을 누릅니다.음. . . 뭔가 검은.
아, Raspberry Pi의 기동 설정을
CLI
로 하고 있었다.$ sudo raspi-config
Boot Options => Desktop / CLI => Desktop Autologin
선택.재기동을 촉구해 오므로, 재기동한다.
시간을 두고 Mac으로 다시 연결하면 ...
이 환경에서는
Window system doesn't support OpenGL.
도 나오지 않게 되었다.요약
-create
옵션을 부여하지 않으면 오류가 발생했습니다. Reference
이 문제에 관하여(RaspberryPi에 x11vnc를 도입하는 단계), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/h-sakano/items/d7b25649525dc985e908텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)