XDMCP(X Display Manager Control Protocol)
UDP ポートの 177 を使います.
古い仕様だけど結構便利. コンソールのGUI画面をリモート先に持ってくる.
XDMCPは、Xming内のxlaunch、MobaXtermにそのクライアント機能が入っている.
ここでは各種OSでXDMCPの設定を施して使ってみる.
OSインストールで「Server with GUI」が選んでいれば、「/etc/gdm/custom.conf」の追記と gdm の再起動、あとfirewallを調整すれば行ける.
[root@rockylinux8 ~]# vi /etc/gdm/custom.conf
:
[xdmcp]
Enable=true
MaxSessions=30
DisplaysPerHost=30
[root@rockylinux8 ~]#
[root@rockylinux8 ~]# systemctl restart gdm.service
[root@rockylinux8 ~]# firewall-cmd --add-service=xdmcp --zone=public --permanent
[root@rockylinux8 ~]# firewall-cmd --reload
これで MpbaXterm で接続すると下記のように「Authentication is Requeired」と言われる. XmingのXlaunch接続でも同様に言われる
カラープロファイルを作る必要があるようで、そのためのアクセス権限が必要ってな感じ. その権限を不要にする修正を施して回避させる
下記のように2つのファイルを作ります
[root@rockylinux8 ~]# vi /etc/polkit-1/localauthority/50-local.d/colord.pkla
[Remove colord dialogs in remote session]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;(*** 注意:意図的に改行してます.下記の行を連結してください****)
org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile;org.debian.pcsc-lite.access_pcsc;org.freedesktop.packagekit.system-sources-refresh
ResultAny=no
ResultInactive=no
ResultActive=yes
[root@rockylinux8 ~]# vi /etc/polkit-1/localauthority/50-local.d/repos.pkla
[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes
[root@rockylinux8 ~]#
その後に所有権らを変更して、polkitを再起動します
[root@rockylinux8 ~]# chmod 644 /etc/polkit-1/localauthority/50-local.d/colord.pkla
[root@rockylinux8 ~]# chmod 644 /etc/polkit-1/localauthority/50-local.d/repos.pkla
[root@rockylinux8 ~]# chown root:root /etc/polkit-1/localauthority/50-local.d/colord.pkla
[root@rockylinux8 ~]# chown root:root /etc/polkit-1/localauthority/50-local.d/repos.pkla
[root@rockylinux8 ~]# systemctl restart polkit.service
これで「Authentication is Requeired」は表示されなくなります
[root@rockylinux8 ~]# systemctl disable gdm.service
[root@rockylinux8 ~]# dnf --enablerepo=epel install lightdm
[root@rockylinux8 ~]# vi /etc/lightdm/lightdm.conf
:
[XDMCPServer]
enabled=true
:
[root@rockylinux8 ~]# dnf groupinstall Xfce
[root@rockylinux8 ~]# firewall-cmd --add-service=xdmcp --zone=public --permanent
[root@rockylinux8 ~]# firewall-cmd --reload
[root@rockylinux8 ~]# reboot
lightdm/Xfce構成なら「Authentication is Requeired」は表示されない
ただ、このままではGNOMEディスクトップ環境も選べてしまう. これを「xfce session」しか選べないようにしてみる.
一応「/etc/lightdm/lightdm.conf」で「user-session=xfce」とすればそれが既定値になる.
その他の選択肢を消すには「/usr/share/xsessions/」と「/usr/share/wayland-sessions/」の「*.desktop」を改名する
[root@rockylinux8 ~]# cd /usr/share/xsessions/
[root@rockylinux8 xsessions]# mv com.redhat.KioskWithKeyboard.desktop com.redhat.KioskWithKeyboard.desktop_
[root@rockylinux8 xsessions]# mv gnome-classic.desktop gnome-classic.desktop_
[root@rockylinux8 xsessions]# mv gnome-custom-session.desktop gnome-custom-session.desktop_
[root@rockylinux8 xsessions]# mv gnome.desktop gnome.desktop_
[root@rockylinux8 xsessions]# mv gnome-xorg.desktop gnome-xorg.desktop_
[root@rockylinux8 xsessions]# mv xinit-compat.desktop xinit-compat.desktop_
[root@rockylinux8 xsessions]# cd /usr/share/wayland-sessions/
[root@rockylinux8 wayland-sessions]#
[root@rockylinux8 wayland-sessions]# mv gnome-classic-wayland.desktop gnome-classic-wayland.desktop_
[root@rockylinux8 wayland-sessions]# mv gnome.desktop gnome.desktop_
[root@rockylinux8 wayland-sessions]# mv gnome-wayland.desktop gnome-wayland.desktop_
こうすると選択肢は「Xfce」のみになる
セキュリティー的な意味合いもありますが、ユーザを一覧させずにユーザ名もinputさせるには「/etc/lightdm/lightdm.conf」で
[Seat:*]
:
greeter-hide-users=true
:
と「greeter-hide-users」を有効にします.
GNOMEではdconfを弄る....windowsのレジストリっぽいもの...
[root@rockylinux8 ~]# vi /etc/dconf/db/gdm.d/01-custom-gdm-settings
[org/gnome/login-screen]
disable-user-list=true
[root@rockylinux8 ~]# dconf update
[root@rockylinux8 ~]# systemctl restart gdm
っでこうなる.
有償版 Xlaunch 7.7.0.72 を使ってます.
設定欄の「Additional parameters for Xming」には「-screen 0 1024x768 -xkblayout jp -xkbmodel jp」を入れてます.
無償版 MobaXterm v23.0 を使ってます.
root@ubuntu:~# grep "VERSION=" /etc/os-release
VERSION="20.04.5 LTS (Focal Fossa)"
root@ubuntu:~# cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 525.89.02 Wed Feb 1 23:23:25 UTC 2023
GCC version: gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
root@ubuntu:~# vi /etc/gdm3/custom.conf
:
[xdmcp]
Enable=true
:
root@ubuntu:~# systemctl restart gdm.service
この設定ではMobaXtermでもXmingでもだめみたい.
root@ubuntu:~# apt install lightdm -y <--- 途中「Default display manager:」と問われるが「lightdm」を選択
root@ubuntu:~# vi /etc/lightdm/lightdm.conf
[LightDM]
start-default-seat=false
[XDMCPServer]
enabled=true
root@ubuntu:~# systemctl disable gdm
root@ubuntu:~# systemctl stop gdm
root@ubuntu:~# systemctl enable lightdm
root@ubuntu:~# systemctl start lightdm
root@ubuntu:~# apt install firewalld
root@ubuntu:~# firewall-cmd --add-service=xdmcp --zone=public --permanent
root@ubuntu:~# firewall-cmd --reload
この設定で一応 Xming でも MobaXterm でも使えた