[root@cnt07 ~]# vi /etc/systemd/system/vncserver@:1.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Edit /etc/systemd/system/vncserver@.service, replacing <USER>
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB’s port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
#
# Use “-localhost” to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the “-via” option in the
# `man vncviewer’ manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[root@cnt07 ~]# vi /etc/systemd/system/vncserver@:2.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Edit /etc/systemd/system/vncserver@.service, replacing <USER>
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB’s port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
#
# Use “-localhost” to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the “-via” option in the
# `man vncviewer’ manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
[root@cnt07 ~]# vi /etc/systemd/system/vncserver@:3.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Edit /etc/systemd/system/vncserver@.service, replacing <USER>
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB’s port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
#
# Use “-localhost” to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the “-via” option in the
# `man vncviewer’ manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
[root@cnt07 ~]# vi /etc/systemd/system/vncserver@:4.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Edit /etc/systemd/system/vncserver@.service, replacing <USER>
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB’s port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use “-nolisten tcp” to prevent X connections to your VNC server via TCP.
#
# Use “-localhost” to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the “-via” option in the
# `man vncviewer’ manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
7月 03 22:07:09 cnt07.localdomain systemd[1]: Starting Remote desktop service (VNC)…
— Subject: Unit vncserver@:1.service has begun start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit vncserver@:1.service has begun starting up.
7月 03 22:07:09 cnt07.localdomain systemd[1]: Started Session c6 of user nakamura.
— Subject: Unit session-c6.scope has finished start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit session-c6.scope has finished starting up.
—
— The start-up result is done.
7月 03 22:07:09 cnt07.localdomain systemd[1]: Starting Session c6 of user nakamura.
— Subject: Unit session-c6.scope has begun start-up
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit session-c6.scope has begun starting up.
7月 03 22:07:09 cnt07.localdomain runuser[9729]: pam_unix(runuser-l:session): session opened for user nakamura by (uid=0)
7月 03 22:07:10 cnt07.localdomain runuser[9729]: Warning: cnt07.localdomain:1 is taken because of /tmp/.X11-unix/X1 ← すでに「/tmp/.X11-unix/X1」ファイルが存在していることが原因と言っています。
7月 03 22:07:10 cnt07.localdomain runuser[9729]: Remove this file if there is no X server cnt07.localdomain:1 ← このファイル「/tmp/.X11-unix/X1」を削除してくださいと言っています。
7月 03 22:07:10 cnt07.localdomain runuser[9729]: A VNC server is already running as :1 ← すでに VNC サーバーが起動していると言っています。
7月 03 22:07:10 cnt07.localdomain runuser[9729]: Warning: cnt07.localdomain:1 is taken because of /tmp/.X11-unix/X1
7月 03 22:07:10 cnt07.localdomain runuser[9729]: Remove this file if there is no X server cnt07.localdomain:1
7月 03 22:07:13 cnt07.localdomain runuser[9729]: New ‘cnt07.localdomain:4 (nakamura)’ desktop is cnt07.localdomain:4
7月 03 22:07:13 cnt07.localdomain runuser[9729]: Starting applications specified in /home/nakamura/.vnc/xstartup
7月 03 22:07:13 cnt07.localdomain runuser[9729]: Log file is /home/nakamura/.vnc/cnt07.localdomain:4.log
7月 03 22:07:13 cnt07.localdomain runuser[9729]: pam_unix(runuser-l:session): session closed for user nakamura
7月 03 22:07:13 cnt07.localdomain systemd[1]: PID file /home/nakamura/.vnc/cnt07.localdomain:1.pid not readable (yet?) after start.
7月 03 22:07:13 cnt07.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
— Subject: Unit vncserver@:1.service has failed
— Defined-By: systemd
— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
—
— Unit vncserver@:1.service has failed.
—
— The result is failed.
7月 03 22:07:13 cnt07.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
7月 03 22:07:13 cnt07.localdomain systemd[1]: vncserver@:1.service failed.
コメント