xrdp のインストール†
munakata@mvc:~$ sudo apt install -y xrdp
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
xorgxrdp
提案パッケージ:
guacamole xrdp-pulseaudio-installer
以下のパッケージが新たにインストールされます:
xorgxrdp xrdp
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 0 個。
498 kB のアーカイブを取得する必要があります。
この操作後に追加で 3,303 kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 xorgxrdp amd64 0.9.5-2 [78.7 kB]
取得:2 http://jp.archive.ubuntu.com/ubuntu bionic/universe amd64 xrdp amd64 0.9.5-2 [419 kB]
498 kB を 3秒 で取得しました (165 kB/s)
以前に未選択のパッケージ xorgxrdp を選択しています。
(データベースを読み込んでいます ... 現在 240686 個のファイルとディレクトリがインストールされています。)
.../xorgxrdp_0.9.5-2_amd64.deb を展開する準備をしています ...
xorgxrdp (0.9.5-2) を展開しています...
以前に未選択のパッケージ xrdp を選択しています。
.../xrdp_0.9.5-2_amd64.deb を展開する準備をしています ...
xrdp (0.9.5-2) を展開しています...
xrdp (0.9.5-2) を設定しています ...
Generating 2048 bit rsa key...
ssl_gen_key_xrdp1 ok
saving to /etc/xrdp/rsakeys.ini
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp-sesman.service → /lib/systemd/system/xrdp-sesman.service.
Created symlink /etc/systemd/system/multi-user.target.wants/xrdp.service → /lib/systemd/system/xrdp.service.
xorgxrdp (0.9.5-2) を設定しています ...
libc-bin (2.27-3ubuntu1) のトリガを処理しています ...
systemd (237-3ubuntu10.29) のトリガを処理しています ...
man-db (2.8.3-2ubuntu0.1) のトリガを処理しています ...
ureadahead (0.100.0-21) のトリガを処理しています ...
セッションタイプがXorgの場合はカーソルのバックグラウンドに黒い四角い領域が表示されてしまうので、new_cursorsを無効にする†
munakata@mvc:~$ sudo sed -e 's/^new_cursors=true/new_cursors=false/g' -i /etc/xrdp/xrdp.ini
munakata@mvc:~$ sudo systemctl restart xrdp
Ubuntu向けにカスタマイズされた設定をロードする為に~/.xsessionrcにて以下の環境変数を設定†
munakata@mvc:~$ cat .xsessionrc
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
セッションタイプをXorgで接続した場合の認証を常に失敗させるルールを追加†
munakata@mvc:~$ sudo cat /etc/polkit-1/localauthority/50-local.d/xrdp-color-manager.pkla
[Netowrkmanager]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device
ResultAny=no
ResultInactive=no
ResultActive=yes
munakata@mvc:~$ sudo systemctl restart polkit
Windows10 のリモートデスクトップ接続で接続する†
参考 URL†