centos7 安装完vnc后无法启动的解决方法

系统环境:centos7 64bit

Job for vncserver@:1.service failed because the control process exited with error code. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.

使用的方法 https://linux.cn/article-5335-1.html
重要的方法特征

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

基于上面的这个方法。其他的也一样。正常情况下,初次安装不会遇到问题,遇到问题的时候是server异常断电的时候

解决的方法

删除/tmp/.X11-unix/ 目录,再启用一次即可

rm -f -R /tmp/.X11-unix/

systemctl enable vncserver@:1.service

提示/tmp/.X11-unix/ 目录是隐藏目录,ls是看不见的。这下面是vnc的临时文件。删除了再启动即可。
平时多看看 systemctl status vncserver@:1.service 不能正常启动的话里面会有非常多的信息在里面。

上一篇
下一篇