ページ「Dropboxのインストール/Debian9.9」と「X11vnc/Debian9.9」の間の差分

提供: とある社畜の頭脳整理
(ページ間の差分)
ナビゲーションに移動 検索に移動
 
 
1行目: 1行目:
= GUIインストール =
+
デスクトップ環境を使用している場合、リモートでデスクトップを使用したい場合があります。<br/>
GUIが利用できる「nautilus-dropbox」を入れていこうと思います。<br/>GNOMEデスクトップ前提なので、GNOMEを使っていない人は、別のパッケージを選択する必要があります。
+
今回はX11vncを使用して、リモートでデスクトップに接続してみようと思います。
  
== 「sources.list」の確認 ==
+
= X11vncのインストール =
今回インストールしようとしている「nautilus-dropbox」は「Non-Freeディストリビューション」に含まれています。<br/>安定版(mainディストリビューション)をインストールしている場合などは、そのままではインストールすることができません。<br/>なので、「sources.list」を加工して「Non-Freeディストリビューション」もインストールできるようにします。
+
下記コマンドを実行して、X11vncをインストールします。
  
「sources.list」ファイルは「/etc/apt」ディレクトリにあります。<br/>修正前は以下の様になっているかと思います。
+
<syntaxhighlight lang="bash">sudo apt-get install x11vnc</syntaxhighlight>
<syntaxhighlight lang="text" line>#
+
(確認されたら「y」を押してください)<br/>
 +
だぁ~っとなってインストールが完了します。
 +
<syntaxhighlight lang="text">test@debian:~$ sudo apt-get install x11vnc
 +
パッケージリストを読み込んでいます... 完了
 +
依存関係ツリーを作成しています               
 +
状態情報を読み取っています... 完了
 +
以下の追加パッケージがインストールされます:
 +
  libtcl8.6 libtk8.6 libvncclient1 libvncserver1 tcl tcl8.6 tk tk8.6 x11vnc-data
 +
提案パッケージ:
 +
  tcl-tclreadline
 +
以下のパッケージが新たにインストールされます:
 +
  libtcl8.6 libtk8.6 libvncclient1 libvncserver1 tcl tcl8.6 tk tk8.6 x11vnc x11vnc-data
 +
アップグレード: 0 個、新規インストール: 10 個、削除: 0 個、保留: 3 個。
 +
3,503 kB のアーカイブを取得する必要があります。
 +
この操作後に追加で 10.3 MB のディスク容量が消費されます。
 +
続行しますか? [Y/n] y
 +
取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 libtcl8.6 amd64 8.6.6+dfsg-1+b1 [985 kB]
 +
取得:2 http://ftp.jp.debian.org/debian stretch/main amd64 libtk8.6 amd64 8.6.6-1+b1 [754 kB]
 +
取得:3 http://ftp.jp.debian.org/debian stretch/main amd64 libvncclient1 amd64 0.9.11+dfsg-1.3~deb9u1 [141 kB]
 +
取得:4 http://ftp.jp.debian.org/debian stretch/main amd64 libvncserver1 amd64 0.9.11+dfsg-1.3~deb9u1 [210 kB]
 +
取得:5 http://ftp.jp.debian.org/debian stretch/main amd64 tcl8.6 amd64 8.6.6+dfsg-1+b1 [123 kB]
 +
取得:6 http://ftp.jp.debian.org/debian stretch/main amd64 tcl amd64 8.6.0+9 [5,468 B]
 +
取得:7 http://ftp.jp.debian.org/debian stretch/main amd64 tk8.6 amd64 8.6.6-1+b1 [71.8 kB]
 +
取得:8 http://ftp.jp.debian.org/debian stretch/main amd64 tk amd64 8.6.0+9 [5,506 B]
 +
取得:9 http://ftp.jp.debian.org/debian stretch/main amd64 x11vnc-data all 0.9.13-2+deb9u1 [216 kB]
 +
取得:10 http://ftp.jp.debian.org/debian stretch/main amd64 x11vnc amd64 0.9.13-2+deb9u1 [992 kB]
  
# deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 NETINST 20190427-10:30]/ stretch main
+
~ 中略 ~
  
#deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 NETINST 20190427-10:30]/ stretch main
+
libc-bin (2.24-11+deb9u4) のトリガを処理しています ...
 +
man-db (2.7.6.1-2) のトリガを処理しています ...
 +
gnome-menus (3.13.3-9) のトリガを処理しています ...
 +
libtcl8.6:amd64 (8.6.6+dfsg-1+b1) を設定しています ...
 +
libtk8.6:amd64 (8.6.6-1+b1) を設定しています ...
 +
tcl8.6 (8.6.6+dfsg-1+b1) を設定しています ...
 +
tk8.6 (8.6.6-1+b1) を設定しています ...
 +
tcl (8.6.0+9) を設定しています ...
 +
tk (8.6.0+9) を設定しています ...
 +
x11vnc (0.9.13-2+deb9u1) を設定しています ...
 +
libc-bin (2.24-11+deb9u4) のトリガを処理しています ...</syntaxhighlight>
  
deb http://ftp.jp.debian.org/debian/ stretch main
+
= 自動ログインの設定 =
deb-src http://ftp.jp.debian.org/debian/ stretch main
+
X11vncですが、基本的にログインしている状態でないと、リモートで接続することができません。<br/>
 +
なので、画面からリモートで接続したいユーザーで自動ログインするようにします。
  
deb http://security.debian.org/debian-security stretch/updates main
+
PC本体にディスプレイ及びキーボード・マウスを接続して、ログイン画面を表示させます。<br/>
deb-src http://security.debian.org/debian-security stretch/updates main
+
[[ファイル:Debian-x11vnc-001.png | 400px]]<br/>
  
# stretch-updates, previously known as 'volatile'
+
パスワードを入力して、「サインイン」をクリックまたはエンターキーを押します。<br/>
deb http://ftp.jp.debian.org/debian/ stretch-updates main
+
[[ファイル:Debian-x11vnc-002.png | 400px]]<br/>
deb-src http://ftp.jp.debian.org/debian/ stretch-updates main</syntaxhighlight>
 
  
要は「stretch mainからしか取得しませんよ」ってなっています。
+
デスクトップが表示されたら、画面右上の下向き矢印「▼」をクリックします。<br/>
 +
[[ファイル:Debian-x11vnc-003.png | 400px]]<br/>
  
これを以下の様に修正します。
+
ログインしているユーザーが表示されるので、それをクリックします。<br/>
 +
[[ファイル:Debian-x11vnc-004.png | 400px]]<br/>
  
<syntaxhighlight lang="text" highlight="7,8,10,11,14,15" line>#
+
「アカウント設定」をクリックします。<br/>
 +
[[ファイル:Debian-x11vnc-005.png | 400px]]<br/>
  
# deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 NETINST 20190427-10:30]/ stretch main
+
「ロック解除」をクリックします。<br/>
 +
[[ファイル:Debian-x11vnc-006.png | 400px]]<br/>
  
#deb cdrom:[Debian GNU/Linux 9.9.0 _Stretch_ - Official amd64 NETINST 20190427-10:30]/ stretch main
+
パスワードの入力が促されるので、ユーザーに対応したパスワードを入力します。<br/>
 +
[[ファイル:Debian-x11vnc-007.png | 400px]]<br/>
  
deb http://ftp.jp.debian.org/debian/ stretch main non-free
+
「認証」ボタンをクリックします。<br/>
deb-src http://ftp.jp.debian.org/debian/ stretch main non-free
+
[[ファイル:Debian-x11vnc-008.png | 400px]]<br/>
  
deb http://security.debian.org/debian-security stretch/updates main non-free
+
ロックが解除されるので、「自動ログイン」をクリックして、「オン」にします。<br/>
deb-src http://security.debian.org/debian-security stretch/updates main non-free
+
[[ファイル:Debian-x11vnc-009.png | 400px]]<br/>
  
# stretch-updates, previously known as 'volatile'
+
設定の確認をするために、ウインドウ左上の左向き矢印「<」をクリックします。<br/>
deb http://ftp.jp.debian.org/debian/ stretch-updates main non-free
+
[[ファイル:Debian-x11vnc-010.png | 400px]]<br/>
deb-src http://ftp.jp.debian.org/debian/ stretch-updates main non-free</syntaxhighlight>
 
  
これで、「non-freeディストリビューション」から取得できるようになりました。
+
「ユーザー」をクリックします。自動ログインがオンになっていればOKです。<br/>
 +
[[ファイル:Debian-x11vnc-011.png | 400px]]<br/>
  
== パッケージの取得とインストール ==
+
最後に「<strong><u>ログインした状態のまま</u></strong>」にしておきます。
パッケージを取得してインストールしていきます。
 
  
=== お約束 ===
+
= X111vncのパスワード設定 =
Debian周りの最新化を行います。<br/><syntaxhighlight lang="bash">sudo apt-get update
+
認証なしで画面が見れてしまうのは危険(特にログインしっぱなし)なので、パスワードを設定します。<br/>
sudo apt-get upgrade
+
以下のコマンドを実行します。
sudo apt-get dist-upgrade</syntaxhighlight>
+
<syntaxhighlight lang="bash">x11vnc -storepasswd</syntaxhighlight>
  
=== 「nautilus-dropbox」のインストール ===
+
すると、パスワードの入力が2回求められるので、2回とも同じパスワードを入力します。<br/>
「apt-get」コマンドで「nautilus-dropbox」をインストールします。<br/><syntaxhighlight lang="bash">sudo apt-get install nautilus-dropbox</syntaxhighlight><br/>すると…以下の様に確認が来ます。<syntaxhighlight lang="text">パッケージリストを読み込んでいます... 完了
+
また、ホームディレクトリの「.vnc」ディレクトリに保存するか問われるので、「y」を入力します<br/>
依存関係ツリーを作成しています               
+
<syntaxhighlight lang="bash">test@debian:~$ x11vnc -storepasswd
状態情報を読み取っています... 完了
+
Enter VNC password:
以下の追加パッケージがインストールされます:
+
Verify password:   
   libappindicator1 libdbusmenu-glib4 libdbusmenu-gtk4 libindicator7 python-gpgme
+
Write password to /home/test/.vnc/passwd?  [y]/n y
以下のパッケージが新たにインストールされます:
+
Password written to: /home/test/.vnc/passwd
   libappindicator1 libdbusmenu-glib4 libdbusmenu-gtk4 libindicator7 nautilus-dropbox python-gpgme
+
test@debian:~$ </syntaxhighlight>
アップグレード: 0 個、新規インストール: 6 個、削除: 0 個、保留: 0 個。
+
 
422 kB のアーカイブを取得する必要があります。
+
= X11vncの起動 =
この操作後に追加で 966 kB のディスク容量が消費されます。
+
最小限のオプションで起動してみます。<br/>
続行しますか? [Y/n] </syntaxhighlight>問題なければ「y」キーを押してください。以下の様にだぁ~っとインストールが開始されます。<syntaxhighlight lang="text">取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 libdbusmenu-glib4 amd64 12.10.2-2 [104 kB]
+
以下のコマンドを実行します。
取得:2 http://ftp.jp.debian.org/debian stretch/main amd64 libdbusmenu-gtk4 amd64 12.10.2-2 [90.8 kB]
+
<syntaxhighlight lang="bash">x11vnc -display :0 -rfbauth ~/.vnc/passwd</syntaxhighlight>
取得:3 http://ftp.jp.debian.org/debian stretch/main amd64 libindicator7 amd64 0.5.0-3+b1 [52.9 kB]
+
上記は、「ディスプレイ番号0(5900ポート)で『~/.vnc/passwd』に設定されたパスワード認証で起動」という意味です。<br/>
取得:4 http://ftp.jp.debian.org/debian stretch/main amd64 libappindicator1 amd64 0.4.92-4 [52.5 kB]
+
以下のようなメッセージが出て、カーソルが点滅して戻ってこなかったら起動しています(色々言われていますが…www)。<br/>
 +
<syntaxhighlight lang="bash">24/06/2019 14:50:39 passing arg to libvncserver: -rfbauth
 +
24/06/2019 14:50:39 passing arg to libvncserver: /home/test/.vnc/passwd
 +
24/06/2019 14:50:39 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 2472
 +
24/06/2019 14:50:39 Using X display :0
 +
24/06/2019 14:50:39 rootwin: 0x280 reswin: 0x1400001 dpy: 0x84e7bfe0
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 ------------------ USEFUL INFORMATION ------------------
 +
24/06/2019 14:50:39 X DAMAGE available on display, using it for polling hints.
 +
24/06/2019 14:50:39  To disable this behavior use: '-noxdamage'
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39  Most compositing window managers like 'compiz' or 'beryl'
 +
24/06/2019 14:50:39  cause X DAMAGE to fail, and so you may not see any screen
 +
24/06/2019 14:50:39  updates via VNC. Either disable 'compiz' (recommended) or
 +
24/06/2019 14:50:39  supply the x11vnc '-noxdamage' command line option.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 Wireframing: -wireframe mode is in effect for window moves.
 +
24/06/2019 14:50:39  If this yields undesired behavior (poor response, painting
 +
24/06/2019 14:50:39   errors, etc) it may be disabled:
 +
24/06/2019 14:50:39    - use '-nowf' to disable wireframing completely.
 +
24/06/2019 14:50:39    - use '-nowcr' to disable the Copy Rectangle after the
 +
24/06/2019 14:50:39      moved window is released in the new position.
 +
24/06/2019 14:50:39   Also see the -help entry for tuning parameters.
 +
24/06/2019 14:50:39  You can press 3 Alt_L's (Left "Alt" key) in a row to
 +
24/06/2019 14:50:39  repaint the screen, also see the -fixscreen option for
 +
24/06/2019 14:50:39  periodic repaints.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 XFIXES available on display, resetting cursor mode
 +
24/06/2019 14:50:39  to: '-cursor most'.
 +
24/06/2019 14:50:39  to disable this behavior use: '-cursor arrow'
 +
24/06/2019 14:50:39  or '-noxfixes'.
 +
24/06/2019 14:50:39 using XFIXES for cursor drawing.
 +
24/06/2019 14:50:39 GrabServer control via XTEST.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 Scroll Detection: -scrollcopyrect mode is in effect to
 +
24/06/2019 14:50:39  use RECORD extension to try to detect scrolling windows
 +
24/06/2019 14:50:39  (induced by either user keystroke or mouse input).
 +
24/06/2019 14:50:39  If this yields undesired behavior (poor response, painting
 +
24/06/2019 14:50:39  errors, etc) it may be disabled via: '-noscr'
 +
24/06/2019 14:50:39  Also see the -help entry for tuning parameters.
 +
24/06/2019 14:50:39  You can press 3 Alt_L's (Left "Alt" key) in a row to
 +
24/06/2019 14:50:39  repaint the screen, also see the -fixscreen option for
 +
24/06/2019 14:50:39  periodic repaints.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 XKEYBOARD: number of keysyms per keycode 10 is greater
 +
24/06/2019 14:50:39  than 4 and 100 keysyms are mapped above 4.
 +
24/06/2019 14:50:39  Automatically switching to -xkb mode.
 +
24/06/2019 14:50:39  If this makes the key mapping worse you can
 +
24/06/2019 14:50:39  disable it with the "-noxkb" option.
 +
24/06/2019 14:50:39  Also, remember "-remap DEAD" for accenting characters.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 X FBPM extension not supported.
 +
24/06/2019 14:50:39 X display is capable of DPMS.
 +
24/06/2019 14:50:39 --------------------------------------------------------
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 Default visual ID: 0x21
 +
24/06/2019 14:50:39 Read initial data from X display into framebuffer.
 +
24/06/2019 14:50:39 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/3200
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 X display :0 is 32bpp depth=24 true color
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 Autoprobing TCP port
 +
24/06/2019 14:50:39 Autoprobing selected TCP port 5900
 +
24/06/2019 14:50:39 Autoprobing TCP6 port
 +
24/06/2019 14:50:39 Autoprobing selected TCP6 port 5900
 +
24/06/2019 14:50:39 listen6: bind: Address already in use
 +
24/06/2019 14:50:39 Not listening on IPv6 interface.
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 Xinerama is present and active (e.g. multi-head).
 +
24/06/2019 14:50:39 Xinerama: number of sub-screens: 1
 +
24/06/2019 14:50:39 Xinerama: no blackouts needed (only one sub-screen)
 +
24/06/2019 14:50:39
 +
24/06/2019 14:50:39 fb read rate: 180 MB/sec
 +
24/06/2019 14:50:39 fast read: reset -wait  ms to: 10
 +
24/06/2019 14:50:39 fast read: reset -defer ms to: 10
 +
24/06/2019 14:50:39 The X server says there are 10 mouse buttons.
 +
24/06/2019 14:50:39 screen setup finished.
 +
24/06/2019 14:50:39
 +
 
 +
The VNC desktop is:      debian:0
 +
PORT=5900
 +
 
 +
******************************************************************************
 +
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
 +
 
 +
The scheme stores pixel data offscreen on the VNC viewer side for faster
 +
retrieval.  It should work with any VNC viewer. Try it by running:
 +
 
 +
    x11vnc -ncache 10 ...
 +
 
 +
One can also add -ncache_cr for smooth 'copyrect' window motion.
 +
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching
 +
 
 +
</syntaxhighlight>
 +
 
 +
VNC Viewerなどで接続してみてください。<br/>
 +
デスクトップが表示されたら、成功です。
 +
 
 +
 
 +
Viewerを終了して気づいた方もいらっしゃるかもしれませんが、この状態だとViewerを終了するとX11vncも終了してしまいます。<br/>
 +
ココらへんは、オプションで設定します。
 +
 
 +
 
 +
先ずは、終了しないようにします。<br/>
 +
終了しないようにするには、「-forever」オプションを指定します。<br/>
 +
<syntaxhighlight lang="bash">x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever</syntaxhighlight>
 +
 
 +
あと…表示されているメッセージに基づいてオプションを設定していきます。
 +
<syntaxhighlight lang="bash">24/06/2019 15:56:31 X DAMAGE available on display, using it for polling hints.
 +
24/06/2019 15:56:31  To disable this behavior use: '-noxdamage'
 +
24/06/2019 15:56:31
 +
24/06/2019 15:56:31  Most compositing window managers like 'compiz' or 'beryl'
 +
24/06/2019 15:56:31  cause X DAMAGE to fail, and so you may not see any screen
 +
24/06/2019 15:56:31  updates via VNC.  Either disable 'compiz' (recommended) or
 +
24/06/2019 15:56:31  supply the x11vnc '-noxdamage' command line option.</syntaxhighlight>
 +
「-noxdamage」を指定したほうが良さそうです。<br/>
 +
(正しく理解できていません…)
 +
<syntaxhighlight lang="bash">x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage</syntaxhighlight>
 +
 
 +
<syntaxhighlight lang="bash">24/06/2019 15:56:31 Wireframing: -wireframe mode is in effect for window moves.
 +
24/06/2019 15:56:31  If this yields undesired behavior (poor response, painting
 +
24/06/2019 15:56:31  errors, etc) it may be disabled:
 +
24/06/2019 15:56:31    - use '-nowf' to disable wireframing completely.
 +
24/06/2019 15:56:31    - use '-nowcr' to disable the Copy Rectangle after the
 +
24/06/2019 15:56:31      moved window is released in the new position.
 +
24/06/2019 15:56:31  Also see the -help entry for tuning parameters.
 +
24/06/2019 15:56:31  You can press 3 Alt_L's (Left "Alt" key) in a row to
 +
24/06/2019 15:56:31  repaint the screen, also see the -fixscreen option for
 +
24/06/2019 15:56:31  periodic repaints.</syntaxhighlight>
 +
「反応が悪い」「塗りつぶしエラー」などが出るのであれば、「-nowf」を設定した方が良いようです。<br/>
 +
「-nowcr」は「ウインドウの移動等をしたあとの、長方形のコピーを無効化」って…よくわからないですね…<br/>
 +
まぁ、エラーが出ない限りは設定する必要はなさそうです。<br/>
 +
 
 +
<syntaxhighlight lang="bash">24/06/2019 16:03:24 XFIXES available on display, resetting cursor mode
 +
24/06/2019 16:03:24  to: '-cursor most'.
 +
24/06/2019 16:03:24  to disable this behavior use: '-cursor arrow'
 +
24/06/2019 16:03:24  or '-noxfixes'.
 +
24/06/2019 16:03:24 using XFIXES for cursor drawing.
 +
24/06/2019 16:03:24 GrabServer control via XTEST.</syntaxhighlight>
 +
「XFIXES」を調べてみたけどがよくわからないな…<br/>
 +
Wikiによると「いくつかのプロトコルの変更」と書かれている…<br/>
 +
ということは、無視したほうが良いのかな?<br/>
 +
無効にする場合は「-cursor arrow」か「-noxfixes」を設定するみたい。
  
 +
<syntaxhighlight lang="bash">24/06/2019 16:03:24 Scroll Detection: -scrollcopyrect mode is in effect to
 +
24/06/2019 16:03:24  use RECORD extension to try to detect scrolling windows
 +
24/06/2019 16:03:24  (induced by either user keystroke or mouse input).
 +
24/06/2019 16:03:24  If this yields undesired behavior (poor response, painting
 +
24/06/2019 16:03:24  errors, etc) it may be disabled via: '-noscr'
 +
24/06/2019 16:03:24  Also see the -help entry for tuning parameters.
 +
24/06/2019 16:03:24  You can press 3 Alt_L's (Left "Alt" key) in a row to
 +
24/06/2019 16:03:24  repaint the screen, also see the -fixscreen option for
 +
24/06/2019 16:03:24  periodic repaints.</syntaxhighlight>
 +
スクロール検出に関する設定???<br/>
 +
「反応が悪い」「塗りつぶしエラー」などが出るのであれば、「-noscr」を設定した方が良いようです。<br/>
 +
ただ…「定期的な再描画については『-fixscreen』を参照」とも言っているので、そちらをヘルプで参照したほうが良いかな?<br/>
  
~~~中略~~~
+
<syntaxhighlight lang="bash">24/06/2019 16:03:24 XKEYBOARD: number of keysyms per keycode 10 is greater
 +
24/06/2019 16:03:24  than 4 and 100 keysyms are mapped above 4.
 +
24/06/2019 16:03:24  Automatically switching to -xkb mode.
 +
24/06/2019 16:03:24  If this makes the key mapping worse you can
 +
24/06/2019 16:03:24  disable it with the "-noxkb" option.
 +
24/06/2019 16:03:24  Also, remember "-remap DEAD" for accenting characters.</syntaxhighlight>
 +
どうやら自動的に「-xkb」モードに変更されているっぽい。<br/>
 +
まぁそれはそれで良いと思うのだけど、メッセージが表示されるのは気持ち悪いので「-xkb」を設定してみる。
 +
<syntaxhighlight lang="bash">x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage -xkb</syntaxhighlight>
  
 +
う~ん…色々設定が合って難しいなぁ~。<br/>
 +
あと、必要そうなオプションは「-loop」です。<br/>
 +
「[https://qtotter.wordpress.com/2013/08/23/%E3%80%90ubuntu%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E5%86%8D%E6%A7%8B%E7%AF%89%E3%80%91no-04-x11vnc%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/ 【ubuntuサーバー再構築】no.04 x11vncを設定してみる – 犬を一匹飼っている]」によると、「こけたらまた起動し直す」ようです。<br/>
  
hicolor-icon-theme (0.15-1) のトリガを処理しています ...
+
まぁ、色々あって最終的には…
libdbusmenu-gtk4:amd64 (12.10.2-2) を設定しています ...
+
<syntaxhighlight lang="bash">x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -loop</syntaxhighlight>
libappindicator1:amd64 (0.4.92-4) を設定しています ...
+
って感じでしょうか?<br/>
libc-bin (2.24-11+deb9u4) のトリガを処理しています ...</syntaxhighlight>
+
もし「キーリピート(キーを押しっぱなしにしたときに連続して入力)」を有効にしたい場合は「-repeat」を設定してください。
  
これで、「nautilus-dropbox」のインストール完了です。
 
  
== 「Dropbox」のダウンロードと初期設定 ==
+
= X11vncの自動起動設定 =
# デスクトップからログインして「アクティビティ」から「ドロップボックス」を起動します。<br/>[[ファイル:Debian-dropbox-001.png | 400px]]<br/><br/>
+
「systemd」を使用して、x11vncをDebian起動時に起動するように設定します。<br/>
# 起動すると、何やら(というか、「Dropboxのアカウントが必要なので登録してね」って内容の)ダイアログが出ますが、サクッと「OK」を押します。<br/>[[ファイル:Debian-dropbox-002.png | 400px]]<br/><br/>
+
まずは、「/etc/systemd/system」ディレクトリに「x11vnc.service」ファイルを作成します。<br/>
# するってぇと、「Dropbox」のダウンロードが始まります。<br/>[[ファイル:Debian-dropbox-003.png | 400px]]<br/><br/>
+
以下のコマンドを実行して、ファイルを作成します。
# ダウンロードが完了すると、引き続きインストールをします。<br/>[[ファイル:Debian-dropbox-004.png | 400px]]<br/><br/>
+
<syntaxhighlight lang="bash">sudo nano /etc/systemd/system/x11vnc.service</syntaxhighlight>
# インストールが完了すると、ブラウザが開いて「Dropboxのログイン画面」が表示されます。<br/>登録済みの、ユーザーIDとパスワードを入力してログインします。<br/>[[ファイル:Debian-dropbox-005.png | 400px]]<br/><br/>
+
内容は以下のとおりです。
# ログインすると以下の様な画面が表示されます。<br/>このままWEB版のDropboxを利用する場合は「Dropboxを続行する」をクリックすれば画面が遷移します。<br/>アカウントの紐付けだけなら、特に何もする必要はありません。<br/>しばらくすると「ファイル(nautilus)」が起動します。<br/>[[ファイル:Debian-dropbox-006.png | 400px]]<br/><br/>
+
<syntaxhighlight lang="bash">[Unit]
# 認証が完了したら、ドロップボックスが同期を始めます。<br/>GNOME3の場合、アイコンは画面左下に表示されます。<br/>(下の画面では同期のマークが出ていませんが、PCと同じくちゃんと表示されます)<br/>[[ファイル:Debian-dropbox-007.png | 400px]]<br/>(追記:同期が完了すると、同期マークは消えるみたいです)<br/><br/>
+
Description=x11vnc (Remote access)
 +
After=network-online.target
  
= CUIインストール =
+
[Service]
CUIと言ってもデスクトップ環境がない状態でインストールを試みたのですが…どうやら、ver74.4.115はデスクトップ環境が必須のようですね。<br/>色々試しましたがダメでした。<br/>試したことを上げておきます。
+
Type=simple
 +
ExecStart=/usr/bin/x11vnc -display :0 -rfbauth /home/[ユーザーID]/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -loop
 +
ExecStop=/bin/kill -TERM $MAINPID
 +
ExecReload=/bin/kill -HUP $MAINPID
 +
KillMode=control-group
 +
Restart=on-failure
 +
User=[ユーザーID]
  
# 普通に「[https://www.dropbox.com/ja/install-linux インストール - Dropbox]」にかかれている通りにインストール。<br/>「~/.dropbox-dist/dropboxd」コマンド実行時に途中で止まってしまいます。<br/>ちなみに「dropbox start」や「dropbox start -i」でも同じところで止まってしまいます。<br/><br/>
+
[Install]
# 「nautilus-dropbox」をインストール<br/>上と同様に、「~/.dropbox-dist/dropboxd」コマンド実行時に途中で止まってしまいます。<br/>「dropbox start」や「dropbox start -i」だと動いているように(「Done!」で終わります)見えますが、アカウントとの連携メッセージが表示されませんでした。<br/>「dropbox status」で確認すると、ずっと「接続中…」のままになります。<br/><br/>
+
WantedBy=graphical.target</syntaxhighlight>
# 「source.list」に無理やりDropboxのリポジトリを追加してインストール<br/>「nautilus-dropbox」と同じ現象になりました。<br/><br/>
+
[ユーザーID](2箇所)を前段でログインしっぱなしにしたユーザーIDに変更してください。
  
デスクトップ環境がない状態でも動かせれば便利なんだけど…
+
そしたらサービスを起動してみます。<br/>
 +
以下のコマンドを実行してください。
 +
<syntaxhighlight lang="bash">sudo systemctl start x11vnc</syntaxhighlight>
 +
正常に実行できているか確認します。
 +
<syntaxhighlight lang="bash">sudo systemctl status x11vnc</syntaxhighlight>
 +
以下の様に表示されれば問題ないかと思います。
 +
<syntaxhighlight lang="bash">test@debian:/etc/systemd/system$ sudo systemctl status x11vnc.service
 +
● x11vnc.service - x11vnc (Remote access)
 +
  Loaded: loaded (/etc/systemd/system/x11vnc.service; disabled; vendor preset: enabled)
 +
  Active: active (running) since Mon 2019-06-24 17:15:29 JST; 2s ago
 +
Main PID: 2761 (x11vnc)
 +
    Tasks: 2 (limit: 4915)
 +
  CGroup: /system.slice/x11vnc.service
 +
          ├─2761 /usr/bin/x11vnc -display :0 -rfbauth /home/test/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -l
 +
          └─2762 /usr/bin/x11vnc -display :0 -rfbauth /home/test/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -l
  
== 少し進展 ==
+
6月 24 17:15:30 debian x11vnc[2761]: 24/06/2019 17:15:30
サービスを起動しているんだけど、どこでどうやって起動しているのか探していて、やっと発見しました。<br/>
+
6月 24 17:15:30 debian x11vnc[2761]: The VNC desktop is:      debian:0
GNOMEのauto startを使用していました。<br/>
+
6月 24 17:15:30 debian x11vnc[2761]: PORT=5900
具体的には「~/.config/autostart」ディレクトリの「dropbox.desktop」というファイルです。<br/>
+
6月 24 17:15:30 debian x11vnc[2761]: ******************************************************************************
中身は以下のようになっています。
+
6月 24 17:15:30 debian x11vnc[2761]: Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
<syntaxhighlight lang="text">[Desktop Entry]
+
6月 24 17:15:30 debian x11vnc[2761]: The scheme stores pixel data offscreen on the VNC viewer side for faster
Name=Dropbox
+
6月 24 17:15:30 debian x11vnc[2761]: retrieval.  It should work with any VNC viewer.  Try it by running:
GenericName=File Synchronizer
+
6月 24 17:15:30 debian x11vnc[2761]:    x11vnc -ncache 10 ...
Comment=Sync your files across computers and to the web
+
6月 24 17:15:30 debian x11vnc[2761]: One can also add -ncache_cr for smooth 'copyrect' window motion.
Exec=dropbox start -i
+
6月 24 17:15:30 debian x11vnc[2761]: More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching</syntaxhighlight>
Terminal=false
+
-ncache」オプションやってみ?みたいなメッセージが出ていますが…無視します。<br/>
Type=Application
+
試しに「-ncache 10」とか設定してつないでみてください。<br/>
Icon=dropbox
+
特に問題なければそれでいいですが…RealVNCのVNC Viewerだと、超縦長な画面になります…。
Categories=Network;FileTransfer;
 
StartupNotify=false</syntaxhighlight>
 
「dropboxd」ではなく「dropbox start -i」で起動しているんですね…。<br/>
 
(結局は一緒って話もありますが…)<br/>
 
これがわかれば「systemd」に変更することでユーザーを変更することもできそうです。
 
  
= 蛇足? =
+
= 雑感 =
* Dropboxのデフォルトの同期先は「~/Dropbox」です
+
自動ログインでログインしっぱなしにする必要があるので、何となく「不安」を感じます。<br/>
* Dropboxはログインと同時に同期を開始します。(ココらへんはPCと同じです)<br/>もし、起動と同時に同期を開始したい場合は「自動ログイン」にする必要があります。<br/>(CUIで起動する場合はユーザーの指定が必要??? - 何時か試したいです)
+
なんか、色々すればどうにかなるみたいですが…無理矢理感が否めないので、私はここまでとします。<br/>
* 外付けのHDD(ext4もOKです)にも同期できますが、sambaのような共有ディレクトリには同期できません。
 
  
 
= 参考サイト =
 
= 参考サイト =
[https://www.garunimo.com/program/linux/_etc_apt_sources_list.php /etc/apt/sources.list(パッケージのダウンロード元設定ファイル・Debian)]
+
[https://qtotter.wordpress.com/2013/08/23/%E3%80%90ubuntu%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E5%86%8D%E6%A7%8B%E7%AF%89%E3%80%91no-04-x11vnc%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/ 【ubuntuサーバー再構築】no.04 x11vncを設定してみる – 犬を一匹飼っている]<br/>
  
 
[[Category:Debian]]
 
[[Category:Debian]]
[[Category:Dropbox]]
+
[[Category:x11vnc]]
 +
{{DISPLAYTITLE:x11vnc/Debian9.9}}}

2019年7月26日 (金) 05:20時点における版

デスクトップ環境を使用している場合、リモートでデスクトップを使用したい場合があります。
今回はX11vncを使用して、リモートでデスクトップに接続してみようと思います。

X11vncのインストール

下記コマンドを実行して、X11vncをインストールします。

sudo apt-get install x11vnc

(確認されたら「y」を押してください)
だぁ~っとなってインストールが完了します。

test@debian:~$ sudo apt-get install x11vnc
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
  libtcl8.6 libtk8.6 libvncclient1 libvncserver1 tcl tcl8.6 tk tk8.6 x11vnc-data
提案パッケージ:
  tcl-tclreadline
以下のパッケージが新たにインストールされます:
  libtcl8.6 libtk8.6 libvncclient1 libvncserver1 tcl tcl8.6 tk tk8.6 x11vnc x11vnc-data
アップグレード: 0 個、新規インストール: 10 個、削除: 0 個、保留: 3 個。
3,503 kB のアーカイブを取得する必要があります。
この操作後に追加で 10.3 MB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 libtcl8.6 amd64 8.6.6+dfsg-1+b1 [985 kB]
取得:2 http://ftp.jp.debian.org/debian stretch/main amd64 libtk8.6 amd64 8.6.6-1+b1 [754 kB]
取得:3 http://ftp.jp.debian.org/debian stretch/main amd64 libvncclient1 amd64 0.9.11+dfsg-1.3~deb9u1 [141 kB]
取得:4 http://ftp.jp.debian.org/debian stretch/main amd64 libvncserver1 amd64 0.9.11+dfsg-1.3~deb9u1 [210 kB]
取得:5 http://ftp.jp.debian.org/debian stretch/main amd64 tcl8.6 amd64 8.6.6+dfsg-1+b1 [123 kB]
取得:6 http://ftp.jp.debian.org/debian stretch/main amd64 tcl amd64 8.6.0+9 [5,468 B]
取得:7 http://ftp.jp.debian.org/debian stretch/main amd64 tk8.6 amd64 8.6.6-1+b1 [71.8 kB]
取得:8 http://ftp.jp.debian.org/debian stretch/main amd64 tk amd64 8.6.0+9 [5,506 B]
取得:9 http://ftp.jp.debian.org/debian stretch/main amd64 x11vnc-data all 0.9.13-2+deb9u1 [216 kB]
取得:10 http://ftp.jp.debian.org/debian stretch/main amd64 x11vnc amd64 0.9.13-2+deb9u1 [992 kB]

~ 中略 ~

libc-bin (2.24-11+deb9u4) のトリガを処理しています ...
man-db (2.7.6.1-2) のトリガを処理しています ...
gnome-menus (3.13.3-9) のトリガを処理しています ...
libtcl8.6:amd64 (8.6.6+dfsg-1+b1) を設定しています ...
libtk8.6:amd64 (8.6.6-1+b1) を設定しています ...
tcl8.6 (8.6.6+dfsg-1+b1) を設定しています ...
tk8.6 (8.6.6-1+b1) を設定しています ...
tcl (8.6.0+9) を設定しています ...
tk (8.6.0+9) を設定しています ...
x11vnc (0.9.13-2+deb9u1) を設定しています ...
libc-bin (2.24-11+deb9u4) のトリガを処理しています ...

自動ログインの設定

X11vncですが、基本的にログインしている状態でないと、リモートで接続することができません。
なので、画面からリモートで接続したいユーザーで自動ログインするようにします。

PC本体にディスプレイ及びキーボード・マウスを接続して、ログイン画面を表示させます。
Debian-x11vnc-001.png

パスワードを入力して、「サインイン」をクリックまたはエンターキーを押します。
Debian-x11vnc-002.png

デスクトップが表示されたら、画面右上の下向き矢印「▼」をクリックします。
Debian-x11vnc-003.png

ログインしているユーザーが表示されるので、それをクリックします。
Debian-x11vnc-004.png

「アカウント設定」をクリックします。
Debian-x11vnc-005.png

「ロック解除」をクリックします。
Debian-x11vnc-006.png

パスワードの入力が促されるので、ユーザーに対応したパスワードを入力します。
Debian-x11vnc-007.png

「認証」ボタンをクリックします。
Debian-x11vnc-008.png

ロックが解除されるので、「自動ログイン」をクリックして、「オン」にします。
Debian-x11vnc-009.png

設定の確認をするために、ウインドウ左上の左向き矢印「<」をクリックします。
Debian-x11vnc-010.png

「ユーザー」をクリックします。自動ログインがオンになっていればOKです。
Debian-x11vnc-011.png

最後に「ログインした状態のまま」にしておきます。

X111vncのパスワード設定

認証なしで画面が見れてしまうのは危険(特にログインしっぱなし)なので、パスワードを設定します。
以下のコマンドを実行します。

x11vnc -storepasswd

すると、パスワードの入力が2回求められるので、2回とも同じパスワードを入力します。
また、ホームディレクトリの「.vnc」ディレクトリに保存するか問われるので、「y」を入力します

test@debian:~$ x11vnc -storepasswd
Enter VNC password: 
Verify password:    
Write password to /home/test/.vnc/passwd?  [y]/n y
Password written to: /home/test/.vnc/passwd
test@debian:~$

X11vncの起動

最小限のオプションで起動してみます。
以下のコマンドを実行します。

x11vnc -display :0 -rfbauth ~/.vnc/passwd

上記は、「ディスプレイ番号0(5900ポート)で『~/.vnc/passwd』に設定されたパスワード認証で起動」という意味です。
以下のようなメッセージが出て、カーソルが点滅して戻ってこなかったら起動しています(色々言われていますが…www)。

24/06/2019 14:50:39 passing arg to libvncserver: -rfbauth
24/06/2019 14:50:39 passing arg to libvncserver: /home/test/.vnc/passwd
24/06/2019 14:50:39 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 2472
24/06/2019 14:50:39 Using X display :0
24/06/2019 14:50:39 rootwin: 0x280 reswin: 0x1400001 dpy: 0x84e7bfe0
24/06/2019 14:50:39 
24/06/2019 14:50:39 ------------------ USEFUL INFORMATION ------------------
24/06/2019 14:50:39 X DAMAGE available on display, using it for polling hints.
24/06/2019 14:50:39   To disable this behavior use: '-noxdamage'
24/06/2019 14:50:39 
24/06/2019 14:50:39   Most compositing window managers like 'compiz' or 'beryl'
24/06/2019 14:50:39   cause X DAMAGE to fail, and so you may not see any screen
24/06/2019 14:50:39   updates via VNC.  Either disable 'compiz' (recommended) or
24/06/2019 14:50:39   supply the x11vnc '-noxdamage' command line option.
24/06/2019 14:50:39 
24/06/2019 14:50:39 Wireframing: -wireframe mode is in effect for window moves.
24/06/2019 14:50:39   If this yields undesired behavior (poor response, painting
24/06/2019 14:50:39   errors, etc) it may be disabled:
24/06/2019 14:50:39    - use '-nowf' to disable wireframing completely.
24/06/2019 14:50:39    - use '-nowcr' to disable the Copy Rectangle after the
24/06/2019 14:50:39      moved window is released in the new position.
24/06/2019 14:50:39   Also see the -help entry for tuning parameters.
24/06/2019 14:50:39   You can press 3 Alt_L's (Left "Alt" key) in a row to 
24/06/2019 14:50:39   repaint the screen, also see the -fixscreen option for
24/06/2019 14:50:39   periodic repaints.
24/06/2019 14:50:39 
24/06/2019 14:50:39 XFIXES available on display, resetting cursor mode
24/06/2019 14:50:39   to: '-cursor most'.
24/06/2019 14:50:39   to disable this behavior use: '-cursor arrow'
24/06/2019 14:50:39   or '-noxfixes'.
24/06/2019 14:50:39 using XFIXES for cursor drawing.
24/06/2019 14:50:39 GrabServer control via XTEST.
24/06/2019 14:50:39 
24/06/2019 14:50:39 Scroll Detection: -scrollcopyrect mode is in effect to
24/06/2019 14:50:39   use RECORD extension to try to detect scrolling windows
24/06/2019 14:50:39   (induced by either user keystroke or mouse input).
24/06/2019 14:50:39   If this yields undesired behavior (poor response, painting
24/06/2019 14:50:39   errors, etc) it may be disabled via: '-noscr'
24/06/2019 14:50:39   Also see the -help entry for tuning parameters.
24/06/2019 14:50:39   You can press 3 Alt_L's (Left "Alt" key) in a row to 
24/06/2019 14:50:39   repaint the screen, also see the -fixscreen option for
24/06/2019 14:50:39   periodic repaints.
24/06/2019 14:50:39 
24/06/2019 14:50:39 XKEYBOARD: number of keysyms per keycode 10 is greater
24/06/2019 14:50:39   than 4 and 100 keysyms are mapped above 4.
24/06/2019 14:50:39   Automatically switching to -xkb mode.
24/06/2019 14:50:39   If this makes the key mapping worse you can
24/06/2019 14:50:39   disable it with the "-noxkb" option.
24/06/2019 14:50:39   Also, remember "-remap DEAD" for accenting characters.
24/06/2019 14:50:39 
24/06/2019 14:50:39 X FBPM extension not supported.
24/06/2019 14:50:39 X display is capable of DPMS.
24/06/2019 14:50:39 --------------------------------------------------------
24/06/2019 14:50:39 
24/06/2019 14:50:39 Default visual ID: 0x21
24/06/2019 14:50:39 Read initial data from X display into framebuffer.
24/06/2019 14:50:39 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/3200
24/06/2019 14:50:39 
24/06/2019 14:50:39 X display :0 is 32bpp depth=24 true color
24/06/2019 14:50:39 
24/06/2019 14:50:39 Autoprobing TCP port 
24/06/2019 14:50:39 Autoprobing selected TCP port 5900
24/06/2019 14:50:39 Autoprobing TCP6 port 
24/06/2019 14:50:39 Autoprobing selected TCP6 port 5900
24/06/2019 14:50:39 listen6: bind: Address already in use
24/06/2019 14:50:39 Not listening on IPv6 interface.
24/06/2019 14:50:39 
24/06/2019 14:50:39 Xinerama is present and active (e.g. multi-head).
24/06/2019 14:50:39 Xinerama: number of sub-screens: 1
24/06/2019 14:50:39 Xinerama: no blackouts needed (only one sub-screen)
24/06/2019 14:50:39 
24/06/2019 14:50:39 fb read rate: 180 MB/sec
24/06/2019 14:50:39 fast read: reset -wait  ms to: 10
24/06/2019 14:50:39 fast read: reset -defer ms to: 10
24/06/2019 14:50:39 The X server says there are 10 mouse buttons.
24/06/2019 14:50:39 screen setup finished.
24/06/2019 14:50:39 

The VNC desktop is:      debian:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

VNC Viewerなどで接続してみてください。
デスクトップが表示されたら、成功です。


Viewerを終了して気づいた方もいらっしゃるかもしれませんが、この状態だとViewerを終了するとX11vncも終了してしまいます。
ココらへんは、オプションで設定します。


先ずは、終了しないようにします。
終了しないようにするには、「-forever」オプションを指定します。

x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever

あと…表示されているメッセージに基づいてオプションを設定していきます。

24/06/2019 15:56:31 X DAMAGE available on display, using it for polling hints.
24/06/2019 15:56:31   To disable this behavior use: '-noxdamage'
24/06/2019 15:56:31 
24/06/2019 15:56:31   Most compositing window managers like 'compiz' or 'beryl'
24/06/2019 15:56:31   cause X DAMAGE to fail, and so you may not see any screen
24/06/2019 15:56:31   updates via VNC.  Either disable 'compiz' (recommended) or
24/06/2019 15:56:31   supply the x11vnc '-noxdamage' command line option.

「-noxdamage」を指定したほうが良さそうです。
(正しく理解できていません…)

x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage
24/06/2019 15:56:31 Wireframing: -wireframe mode is in effect for window moves.
24/06/2019 15:56:31   If this yields undesired behavior (poor response, painting
24/06/2019 15:56:31   errors, etc) it may be disabled:
24/06/2019 15:56:31    - use '-nowf' to disable wireframing completely.
24/06/2019 15:56:31    - use '-nowcr' to disable the Copy Rectangle after the
24/06/2019 15:56:31      moved window is released in the new position.
24/06/2019 15:56:31   Also see the -help entry for tuning parameters.
24/06/2019 15:56:31   You can press 3 Alt_L's (Left "Alt" key) in a row to 
24/06/2019 15:56:31   repaint the screen, also see the -fixscreen option for
24/06/2019 15:56:31   periodic repaints.

「反応が悪い」「塗りつぶしエラー」などが出るのであれば、「-nowf」を設定した方が良いようです。
「-nowcr」は「ウインドウの移動等をしたあとの、長方形のコピーを無効化」って…よくわからないですね…
まぁ、エラーが出ない限りは設定する必要はなさそうです。

24/06/2019 16:03:24 XFIXES available on display, resetting cursor mode
24/06/2019 16:03:24   to: '-cursor most'.
24/06/2019 16:03:24   to disable this behavior use: '-cursor arrow'
24/06/2019 16:03:24   or '-noxfixes'.
24/06/2019 16:03:24 using XFIXES for cursor drawing.
24/06/2019 16:03:24 GrabServer control via XTEST.

「XFIXES」を調べてみたけどがよくわからないな…
Wikiによると「いくつかのプロトコルの変更」と書かれている…
ということは、無視したほうが良いのかな?
無効にする場合は「-cursor arrow」か「-noxfixes」を設定するみたい。

24/06/2019 16:03:24 Scroll Detection: -scrollcopyrect mode is in effect to
24/06/2019 16:03:24   use RECORD extension to try to detect scrolling windows
24/06/2019 16:03:24   (induced by either user keystroke or mouse input).
24/06/2019 16:03:24   If this yields undesired behavior (poor response, painting
24/06/2019 16:03:24   errors, etc) it may be disabled via: '-noscr'
24/06/2019 16:03:24   Also see the -help entry for tuning parameters.
24/06/2019 16:03:24   You can press 3 Alt_L's (Left "Alt" key) in a row to 
24/06/2019 16:03:24   repaint the screen, also see the -fixscreen option for
24/06/2019 16:03:24   periodic repaints.

スクロール検出に関する設定???
「反応が悪い」「塗りつぶしエラー」などが出るのであれば、「-noscr」を設定した方が良いようです。
ただ…「定期的な再描画については『-fixscreen』を参照」とも言っているので、そちらをヘルプで参照したほうが良いかな?

24/06/2019 16:03:24 XKEYBOARD: number of keysyms per keycode 10 is greater
24/06/2019 16:03:24   than 4 and 100 keysyms are mapped above 4.
24/06/2019 16:03:24   Automatically switching to -xkb mode.
24/06/2019 16:03:24   If this makes the key mapping worse you can
24/06/2019 16:03:24   disable it with the "-noxkb" option.
24/06/2019 16:03:24   Also, remember "-remap DEAD" for accenting characters.

どうやら自動的に「-xkb」モードに変更されているっぽい。
まぁそれはそれで良いと思うのだけど、メッセージが表示されるのは気持ち悪いので「-xkb」を設定してみる。

x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage -xkb

う~ん…色々設定が合って難しいなぁ~。
あと、必要そうなオプションは「-loop」です。
【ubuntuサーバー再構築】no.04 x11vncを設定してみる – 犬を一匹飼っている」によると、「こけたらまた起動し直す」ようです。

まぁ、色々あって最終的には…

x11vnc -display :0 -rfbauth ~/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -loop

って感じでしょうか?
もし「キーリピート(キーを押しっぱなしにしたときに連続して入力)」を有効にしたい場合は「-repeat」を設定してください。


X11vncの自動起動設定

「systemd」を使用して、x11vncをDebian起動時に起動するように設定します。
まずは、「/etc/systemd/system」ディレクトリに「x11vnc.service」ファイルを作成します。
以下のコマンドを実行して、ファイルを作成します。

sudo nano /etc/systemd/system/x11vnc.service

内容は以下のとおりです。

[Unit]
Description=x11vnc (Remote access)
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -rfbauth /home/[ユーザーID]/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -loop
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
KillMode=control-group
Restart=on-failure
User=[ユーザーID]

[Install]
WantedBy=graphical.target

[ユーザーID](2箇所)を前段でログインしっぱなしにしたユーザーIDに変更してください。

そしたらサービスを起動してみます。
以下のコマンドを実行してください。

sudo systemctl start x11vnc

正常に実行できているか確認します。

sudo systemctl status x11vnc

以下の様に表示されれば問題ないかと思います。

test@debian:/etc/systemd/system$ sudo systemctl status x11vnc.service
● x11vnc.service - x11vnc (Remote access)
   Loaded: loaded (/etc/systemd/system/x11vnc.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-06-24 17:15:29 JST; 2s ago
 Main PID: 2761 (x11vnc)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/x11vnc.service
           ├─2761 /usr/bin/x11vnc -display :0 -rfbauth /home/test/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -l
           └─2762 /usr/bin/x11vnc -display :0 -rfbauth /home/test/.vnc/passwd -forever -noxdamage -xkb -wf -cursor most -fixscreen V=10 -fixscreen C=10 -l

 6月 24 17:15:30 debian x11vnc[2761]: 24/06/2019 17:15:30
 6月 24 17:15:30 debian x11vnc[2761]: The VNC desktop is:      debian:0
 6月 24 17:15:30 debian x11vnc[2761]: PORT=5900
 6月 24 17:15:30 debian x11vnc[2761]: ******************************************************************************
 6月 24 17:15:30 debian x11vnc[2761]: Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
 6月 24 17:15:30 debian x11vnc[2761]: The scheme stores pixel data offscreen on the VNC viewer side for faster
 6月 24 17:15:30 debian x11vnc[2761]: retrieval.  It should work with any VNC viewer.  Try it by running:
 6月 24 17:15:30 debian x11vnc[2761]:     x11vnc -ncache 10 ...
 6月 24 17:15:30 debian x11vnc[2761]: One can also add -ncache_cr for smooth 'copyrect' window motion.
 6月 24 17:15:30 debian x11vnc[2761]: More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

「-ncache」オプションやってみ?みたいなメッセージが出ていますが…無視します。
試しに「-ncache 10」とか設定してつないでみてください。
特に問題なければそれでいいですが…RealVNCのVNC Viewerだと、超縦長な画面になります…。

雑感

自動ログインでログインしっぱなしにする必要があるので、何となく「不安」を感じます。
なんか、色々すればどうにかなるみたいですが…無理矢理感が否めないので、私はここまでとします。

参考サイト

【ubuntuサーバー再構築】no.04 x11vncを設定してみる – 犬を一匹飼っている
}