Vncserver Died

Home » CentOS » Vncserver Died
CentOS No Comments

I get back from two weeks on the road, and try to VNC to my server and it fails. I SSH in and see that, yes VNCserver is dead. I tried restarting it and see below for the failure messages plus my systemd setup.

Can someone point me to trouble shooting why it says about resources (if that is the problem);

# systemctl -l status VNCserver@:3.service
● VNCserver@:3.service – Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled;
vendor preset: disabled)
Active: failed (Result: resources) since Fri 2017-07-28 13:31:15
EDT; 54s ago
Process: 19173 ExecStart=/usr/sbin/runuser -l root -c
/usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 19170 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i >
/dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Jul 28 13:31:12 homebase.home.htt systemd[1]: Starting Remote desktop service (VNC)… Jul 28 13:31:15 homebase.home.htt systemd[1]: PID file
/home/root/.vnc/homebase.home.htt:3.pid not readable (yet?) after start. Jul 28 13:31:15 homebase.home.htt systemd[1]: Failed to start Remote desktop service (VNC). Jul 28 13:31:15 homebase.home.htt systemd[1]: Unit VNCserver@:3.service entered failed state. Jul 28 13:31:15 homebase.home.htt systemd[1]: VNCserver@:3.service failed.

# cat /etc/systemd/system/vncserver@.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
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l -c “/usr/bin/vncserver %i”
# PIDFile=/home//.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable VNCserver@:.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 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=/home/root/.vnc/%H%i.pid ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’

[Install]
WantedBy=multi-user.target

# cat /etc/systemd/system/multi-user.target.wants/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
# with the actual user name. Leave the remaining lines of the file unmodified
# (ExecStart=/usr/sbin/runuser -l -c “/usr/bin/vncserver %i”
# PIDFile=/home//.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable VNCserver@:.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 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=/home/root/.vnc/%H%i.pid ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’

[Install]
WantedBy=multi-user.target