I follow http://www.linuxexplorers.com/2014/04/configure-vnc-server-in-red-hat-enterprise-linux-7-rhel7/ to configure the RHEL 7 VNC server.
At the final configuration step "systemctl start vncserver@:1.service", I got
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and 'journalctl -xn' for details.
journalctl -xn
-- Logs begin at Tue 2014-09-02 14:17:21 CDT, end at Tue 2014-09-02 15:28:53 CDT. --
Sep 02 15:28:53 xx.xx.xx.com systemd[1]: Started Session c2 of user zzz.
-- Subject: Unit session-c2.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-c2.scope has finished starting up.
--
-- The start-up result is done.
Sep 02 15:28:53 xx.xx.xx.com runuser[42609]: pam_unix(runuser-l:session): session opened for user yyy
Sep 02 15:28:53 xx.xx.xx.com runuser[42609]: Warning: xx.xx.xx.com:1 is taken because of /tmp
Sep 02 15:28:53 xx.xx.xx.com runuser[42609]: Remove this file if there is no X server xx.xx.xx.com
Sep 02 15:28:53 xx.xx.xx.com runuser[42609]: A VNC server is already running as :1
Sep 02 15:28:53 xx.xx.xx.com runuser[42609]: pam_unix(runuser-l:session): session closed for user yyy
Sep 02 15:28:53 xx.xx.xx.com systemd[1]: vncserver@:1.service: control process exited, code=exited s
Sep 02 15:28:53 xx.xx.xx.com 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.
Sep 02 15:28:53 xx.xx.xx.com systemd[1]: Unit vncserver@:1.service entered failed state.
Sep 02 15:28:53 xx.xx.xx.com systemd[1]: Failed to mark scope session-c2.scope as abandoned : Stale
Best Answer
For some reason, it looks like an instance of vncserver is already running. Now why you can't connect is probably a different question/problem
The error messages direct you to remove the /tmp lock files. Remove those messages as recommended, and try again.
From a colleague..
Either there is already a VNC server instance running on :1, or the previous :1 VNC instance was not shut down properly. Either way, the vncserver is checking and finding temporary files for the :1 session in the
/tmp/.X11-unix
directory.The correct way to shut down a VNC server is to use
vncserver -kill :1
. This should be done before the system is restarted, either manually or in a shutdown script.If there is no VNC server :1 instance already running, clean out the
/tmp/.X11-unix
directory and try to restart the vncserver.