vncでは個別にvncサーバを起動させてました。
ここではXDMCPをそのままvncに乗せたいと思います。

参照先:https://www.ibm.com/developerworks/jp/opensource/library/os-multiuserloginsvnc/index.html
https://www.itzgeek.com/how-tos/linux/centos-how-tos/remote-login-with-gdm-and-vnc-on-centos-7-rhel-7-configure-vnc-on-xinetd-with-xdmcp-centos-7-rhel-7.html

まずはXDMCPを有効にします

xdmcpを有効に

ここではgdmを対象にしてます

[root@rockylinux9 ~]# vi /etc/gdm/custom.conf
# GDM configuration storage
 
[daemon]
# Uncomment the line below to force the login screen to use Xorg
#WaylandEnable=false
 
[security]
AllowRemoteRoot=true
DisallowTCP=false
 
[xdmcp]
Enable=true
 
[chooser]
 
[debug]
# Uncomment the line below to turn on debugging
#Enable=true
 
[root@rockylinux9 ~]#

設定後にgdmを再起動させます。

[root@rockylinux9 ~]# systemctl restart gdm

xinetdの準備

次にxinetdを入れてvncを有効にさせます

yum install xinetd

っが RHEL9 系から xinetd は廃止となりました.
なので xinetd 内のサービスを systemd に移し替えて使うようにします

vnc serverをインストール

[root@rockylinux9 ~]# dnf install tigervnc-server-minimal

systemdの準備

RHEL9系向けに vncserver@xinetd を systemd で賄うようにします

RHEL7/8系なら /etc/xinetd.d/vncserver を下記にしますが、

service vncserver
{
   disable     = no
   socket_type = stream
   protocol    = tcp
   wait        = no
   user        = nobody
   server      = /usr/bin/Xvnc
   server_args = -inetd -once -query localhost -geometry 1024x768 -depth 16 -securitytypes=none
   type        = UNLISTED
   port        = 5900
}

これを「/etc/systemd/system/vncserver.socket」「/etc/systemd/system/vncserver@.service」として作って

[root@rockylinux9 ~]# vi /etc/systemd/system/vncserver.socket
[Unit]
Description=VNCserver Socket
 
[Socket]
ListenStream=5900
Accept=yes                          
 
[Install]
WantedBy=sockets.target
 
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# vi /etc/systemd/system/vncserver@.service
[Unit]
Description=VNCserver Per-Connection Server
 
[Service]
ExecStart=/usr/bin/Xvnc -inetd -once -query localhost -geometry 1024x768 -depth 16 -securitytypes=none
User=nobody
Group=nobody
StandardInput=socket
 
[root@rockylinux9 ~]#

作ったsocketを有効にして起動させます

[root@rockylinux9 ~]# systemctl enable vncserver.socket
Created symlink /etc/systemd/system/sockets.target.wants/vncserver.socket → /etc/systemd/system/vncserver.socket.
 
[root@rockylinux9 ~]#
[root@rockylinux9 ~]# systemctl start vncserver.socket
 
[root@rockylinux9 ~]# systemctl status vncserver.socket
● vncserver.socket - VNCserver Socket
     Loaded: loaded (/etc/systemd/system/vncserver.socket; enabled; vendor preset: disabled)
     Active: active (listening) since Thu 2023-04-13 11:29:13 JST; 11s ago
      Until: Thu 2023-04-13 11:29:13 JST; 11s ago
     Listen: [::]:5900 (Stream)
   Accepted: 0; Connected: 0;
      Tasks: 0 (limit: 101932)
     Memory: 8.0K
        CPU: 430us
     CGroup: /system.slice/vncserver.socket
 
Apr 13 11:29:13 rockylinux9 systemd[1]: Listening on VNCserver Socket.
[root@rockylinux9 ~]#

firewall

5900を使うのでまずは「/usr/lib/firewalld/services/」にサービス登録があるかを調べる
どうやら「/usr/lib/firewalld/services/vnc-server.xml」が 5900-5903/tcp をカバーしているのでこれを適用します

[root@rockylinux9 ~]# firewall-cmd --add-service=vnc-server --zone=public --permanent
[root@rockylinux9 ~]# firewall-cmd --reload

vncビューアでアクセス

windowsPCでVNC Viewerを使ってます. https://www.realvnc.com/en/connect/download/viewer/

アプリを起動させ、接続先に「rockylinux9」と入力してリターンすると画面が開きます
2023y04m13d_114206292.png

相手先との通信に暗号化されていないと下記のようなメッセージが表示されます
2023y04m13d_113827576.png
どうすれば暗号化させた通信になるのかは調べてないです

っで上手く行くと下記のようになる
2023y04m13d_114553051.png

ただ、、、残念なことに画面解像度は「vncserver@.service」に記載した値の固定となるので、微妙かなぁ...

最新の60件
2023-12-06 2023-12-05 2023-11-30 2023-11-27 2023-11-21 2023-11-19 2023-11-18 2023-11-14 2023-11-10 2023-11-09 2023-11-05 2023-11-03 2023-10-31 2023-10-30 2023-10-26 2023-10-24 2023-10-19 2023-10-16 2023-10-15 2023-10-12 2023-10-11 2023-10-09 2023-10-03 2023-10-02 2023-09-30 2023-09-29 2023-09-26 2023-09-24 2023-09-19 2023-09-18 2023-09-17 2023-09-16 2023-09-14 2023-09-12 2023-09-11 2023-09-08 2023-09-05 2023-09-02 2023-08-30 2023-08-29

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-04-13 (木) 11:49:21