概要
AWSのEC2でRedhatのインスタンスを立上げ、
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-TigerVNC#sec-starting-vncserver
を参考に、TigerVNCのインストールを行ったのですが、
$ systemctl restart vncserver@:1
を入力して、vncserverを起動を試み、
$ systemctl status vncserver@:1 -lを入力して
起動状態を確認したところ、
[root@ip-xxx-xx-xx-xxx tmp]# systemctl start vncserver@:1 [root@ip-xxx-xx-xx-xxx tmp]# systemctl status vncserver@:1 -l ● vncserver@:1.service - Remote desktop service (VNC) Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: disabled) Active: inactive (dead) since Sun 2018-11-25 15:36:25 UTC; 3s ago Process: 17365 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS) Process: 17321 ExecStart=/usr/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS) Process: 17319 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS) Main PID: 17339 (code=exited, status=0/SUCCESS) Nov 25 15:36:22 ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal systemd[1]: Starting Remote desktop service (VNC)... Nov 25 15:36:25 ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal systemd[1]: Started Remote desktop service (VNC).
エラーは発生していないのですが、vncが起動状態となりませんでした。
RealVNCで接続を試みたところ、
ホストへの接続ができません:接続を拒絶しました(10061)
というメッセージが表示されました。
実施した作業の詳細
・TigerVNCのインストール
yum install tigervnc-server.x86_64
・パスワードの設定
# vncpasswd Password: Verify: Would you like to enter a view-only password (y/n)? n A view-only password is not used
・/etc/systemd/system/vncserver@.serviceの修正
# vncpasswd [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i" PIDFile=/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' [Install] WantedBy=multi-user.target "/etc/systemd/system/vncserver@.service" 48L, 1815C written
稚拙な質問で申し訳ございません。
どなたが原因について思い当たる方がいらっしゃいましたら、
ご意見をお願い致します。
・vncserver1実行結果
[root@ip-xxx-xx-xx-xxx ~]# vncserver :1 New 'ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1 (root)' desktop is ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1.log
・/root/.vnc/ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1.log確認
[root@ip-xxx-xx-xx-xxx ~]# cat /root/.vnc/ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1.log Xvnc TigerVNC 1.8.0 - built Aug 31 2018 12:04:07 Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt) See http://www.tigervnc.org for information on TigerVNC. Underlying X server release 12001000, The X.Org Foundation Mon Nov 26 22:04:43 2018 vncext: VNC extension running! vncext: Listening for VNC connections on all interface(s), port 5901 vncext: created VNC server for screen 0 Killing Xvnc process ID 20550
・vncserver -list
[root@ip-xxx-xx-xx-xxx ~]# vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID [root@ip-xxx-xx-xx-xxx ~]#
・ vncserver -noxstartup実行結果
[root@ip-xxx-xx-xx-xxx ~]# vncserver -noxstartup :1 New 'ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1 (root)' desktop is ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1 Log file is /root/.vnc/ip-xxx-xx-xx-xxx.ap-northeast-1.compute.internal:1.log [root@ip-xxx-xx-xx-xxx ~]# vncserver -list TigerVNC server sessions: X DISPLAY # PROCESS ID :1 4500
・/root/.vnc/xstartupの内容
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS /etc/X11/xinit/xinitrc #vncserver -kill $DISPLAY ~

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/28 17:20 編集
2018/11/29 00:23
2018/11/29 12:31
2018/11/29 13:13
2018/11/29 14:04 編集
2018/11/29 14:46
2018/11/29 15:24