Centos7 安装VNC后、启动服务失败?报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

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

爱吃鱼的程序员 2020-06-09 10:29:33 134

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



请问哪里不对了。


Shell Linux C# Windows
分享到
取消 提交回答
全部回答(1)
  • 爱吃鱼的程序员
    2020-06-09 10:29:49

    问题已解决

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





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

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

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程