Centos7 安装VNC后、启动服务失败

静坐的时光丶 发布于 2016/09/19 11:05
阅读 3K+
收藏 1

想实现WINDOWS系统远程连接Centos7

根据网上http://www.linuxidc.com/Linux/2015-04/116725.htm

文章复制vncserver@.service文件为vncserver@:1.service

修改了vncserver@:1.service文件root用户登录

[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=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
但是启动一直报错

[root@localhost Desktop]# systemctl daemon-reload
[root@localhost Desktop]# systemctl start vncserver@:1.service
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.
[root@localhost Desktop]# sudo systemctl status  vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/usr/lib/systemd/system/vncserver@:1.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2016-09-19 10:56:05 CST; 4s ago
  Process: 8861 ExecStart=/usr/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=2)
  Process: 8858 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Sep 19 10:56:04 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Sep 19 10:56:05 localhost.localdomain systemd[1]: vncserver@:1.service: control process exited, code=exited status=2
Sep 19 10:56:05 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Sep 19 10:56:05 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
Sep 19 10:56:05 localhost.localdomain systemd[1]: vncserver@:1.service failed.



请问哪里不对了。


加载中
0
静坐的时光丶
静坐的时光丶

问题已解决

rm -rf /tmp/.X11-unix/* 





0
KongFanhao
KongFanhao

可以看一下我原来装的vnc记录

https://my.oschina.net/u/2561483/blog/676894

返回顶部
顶部