1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Raspberry Pi 4B 仮想デスクトップ

Last updated at Posted at 2019-12-09

【前文】

RPi4B + Buster + Kodi 18.4 は中々快適。
しかし、kodi 起動中、デスクトップが無効になってしまうのが難点。VNC で接続してもデスクトップが操作できない。パワー、メモリが有り余っている RPi4B 4G でこれは勿体ない。(日本人的発想)
そこで仮想デスクトップを利用してみることにした。

【環境】

VNC接続環境は構築済みとする。

Pi OS 母艦 VNCクライアント
4B 4G Raspbian Buster with desktop September 2019 Windows10 64bit VNC Viewer 6.17.1113(r31799)

【仮想デスクトップ起動接続】

TeraTerm等のターミナルから vncserver実行で仮想デスクトップ生成。

pi@raspberrypi4:~ $ vncserver
VNC(R) Server 6.5.0 (r41824) ARMv6 (Aug 16 2019 00:24:44)
Copyright (C) 2002-2019 RealVNC Ltd.
RealVNC and VNC are trademarks of RealVNC Ltd and are protected by trademark
registrations and/or pending trademark applications in the European Union,
United States of America and other jurisdictions.
Protected by UK patent 2481870; US patent 8760366; EU patent 2652951.
See https://www.realvnc.com for information on VNC.
For third party acknowledgements see:
https://www.realvnc.com/docs/6/foss.html
OS: Raspbian GNU/Linux 10, Linux 4.19.75, armv7l

On some distributions (in particular Red Hat), you may get a better experience
by running vncserver-virtual in conjunction with the system Xorg server, rather
than the old version built-in to Xvnc. More desktop environments and
applications will likely be compatible. For more information on this alternative
implementation, please see: https://www.realvnc.com/doclink/kb-546

Running applications in /etc/vnc/xstartup

VNC Server catchphrase: "Letter good Thomas. Chaos castle Martin."
             signature: 57-06-3b-f8-50-75-67-44

Log file is /home/pi/.vnc/raspberrypi4:1.log
New desktop is raspberrypi4:1 (192.168.11.113:1)
pi@raspberrypi4:~ $

最後に表示される IPアドレス:n (上記の場合は 192.168.11.113:1) が仮想デスクトップ接続先。
通常の VNC接続同様に VNC Viewer で接続先を作成し接続。

仮想デスクトップ表示。

デフォルトの解像度は 1024x768。
終了は vncserver -kill :n

pi@raspberrypi4:~ $ vncserver -kill :1

因みにターミナルは閉じても仮想デスクトップは生きている。

解像度を指定したい場合は、vncserver -geometry WxH。(仮想デスクトップ上で解像度の変更はできない)
RPi4B は 4K対応が売りの一つ。しかし残念ながら自分が使用しているモニタ(TV)は 4K非対応。そこでせめて仮想デスクトップで 4K を体験。

pi@raspberrypi4:~ $ vncserver -geometry 3840x2160
お~、広い。

更に 8K。

pi@raspberrypi4:~ $ vncserver -geometry 7680x4320
うははは。 というか、キャプチャ画像がでか過ぎてアップロードに失敗するので縮小したよ。

調子に乗って 16K を試したが、流石にダメだった。(生成自体は出来てるっぽいけど接続でエラー)

【非GUI環境】

公式ヘルプによれば、非GUI環境でも必要なパッケージさえインストールすれば、仮想デスクトップが利用できるとのことで、そちらも試してみた。
環境は RPi Zero + Raspbian Buster Lite。

公式ヘルプには、
sudo apt install realvnc-vnc-server realvnc-vnc-viewer
で環境が揃うっぽいことが書かれているが駄目だった。
vncserver はエラーにもならず、仮想デスクトップの接続先が示されるが、VNC Viewer で接続しようとするとエラーで繋がらない。

公式フォーラムにあたってみると、
sudo apt install raspberrypi-ui-mods
も必要っぽいので入れてみたら、それが正解だった。かなり時間がかかったけど……。

どうやらここら辺の依存関係にバグがあるっぽい。
本来なら realvnc-vnc-server の追加インストールで raspberrypi-ui-mods もインストールされるべきなのに、そうならない、って状況っぽい。

というか、仮想デスクトップとはいえ、まがりなりにもデスクトップ環境を利用するなら、最初から素直に with desktop版を入れるべきか。

【公式ヘルプ】

VNC (Virtual Network Computing)
vncserver-virtual Man Page

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?