开发者社区> 问答> 正文

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

想实现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.



请问哪里不对了。


展开
收起
爱吃鱼的程序员 2020-06-09 10:29:33 1799 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    问题已解决

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





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

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

    2020-06-09 10:29:49
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载
低代码开发师(初级)实战教程 立即下载