我跟随http://www.linuxexplorers.com/2014/04/configure-vnc-server-in-red-hat-enterprise-linux-7-rhel7/配置 RHEL 7 VNC 服务器。
在最后的配置步骤“systemctl start vncserver@:1.service”中,我得到了
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
答案1
出于某种原因,vncserver 的一个实例似乎已在运行。现在,为什么无法连接可能是另一个问题/问题
错误消息指示您删除 /tmp 锁定文件。按照建议删除这些消息,然后重试。
来自一位同事..
:1 上已有一个 VNC 服务器实例正在运行,或者之前的 :1 VNC 实例未正确关闭。无论哪种情况,vncserver 都会在目录中检查并查找 :1 会话的临时文件/tmp/.X11-unix
。
关闭 VNC 服务器的正确方法是使用vncserver -kill :1
。这应该在系统重新启动之前完成,可以手动完成,也可以在关机脚本中完成。
如果没有正在运行的 VNC 服务器:1 实例,请清理目录/tmp/.X11-unix
并尝试重新启动 vncserver。
答案2
Job for vncserver@:7.service failed. See 'systemctl status vncserver@:7.service' and 'journalctl -xn' for details.
删除此文件夹:
rm -r /tmp/.X11-unix/
这是对我的工作。
参考: