解决方案:

我们可以手动终止该进程,也可以按照正确的配置步骤并使用不同的登录会话编号。
我手动尝试终止会话但没有成功。
所以最后我分配了一个不同的会话号。

# vi /etc/sysconfig/vncservers
VNCSERVERS="3:root"
# service vncserver restart
Shutting down VNC server: 3:root                           [FAILED]
Starting VNC server: 3:root
New 'server.example.com:3 (root)' desktop is server.example.com:3
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/server.example.com:3.log            [  OK  ]

原因

在启动服务之前没有遵循正确的配置步骤,导致无法自动杀掉原来的进程

问题

启动 vncserver报错:

# service vncserver restart
Shutting down VNC server: 2:root [FAILED]
Starting VNC server: 2:root A VNC server is already running as :2 [FAILED]
# vncserver -kill :2
Can't find file /root/.vnc/server.example.com:2.pid
You'll have to kill the Xvnc process bananaally
vncserver You'll have to kill the Xvnc process bananaally
日期:2020-06-02 22:17:20 来源:oir作者:oir