• Unable to VNC onto Centos server remotely


    用的好好的vncserver 突然遇到这个错误:

    [vnc@localhost ~]$ sudo systemctl status vncserver@:1.service -l
    ● vncserver@:1.service - Remote desktop service (VNC)
    Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since 日 2016-05-29 22:13:19 EDT; 6min ago
    Process: 2888 ExecStart=/usr/sbin/runuser -l vnc -c /usr/bin/vncserver %i (code=exited, status=2)
    Process: 1576 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

    5月 29 22:13:12 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
    5月 29 22:13:19 localhost.localdomain systemd[1]: vncserver@:1.service: control process exited, code=exited status=2
    5月 29 22:13:19 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
    5月 29 22:13:19 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
    5月 29 22:13:19 localhost.localdomain systemd[1]: vncserver@:1.service failed.
    5月 29 22:13:19 localhost.localdomain runuser[2888]: Warning: localhost.localdomain:1 is taken because of /tmp/.X11-unix/X1
    5月 29 22:13:19 localhost.localdomain runuser[2888]: Remove this file if there is no X server localhost.localdomain:1
    5月 29 22:13:19 localhost.localdomain runuser[2888]: A VNC server is already running as :1

    查看日志的最后一行是“A VNC server is already running as :1”,

    于是我就把/etc/systemd/system/下的 vncserver@:1.service 改成 vncserver@:2.service

    执行:

    # systemctl disable vncserver@:1.service

    # systemctl daemon-reload

    # systemctl start vncserver@:2.service

    # systemctl enable vncserver@:2.service

    查了一下:

    # systemctl status vncserver@:2.service

    运行状态是active:-)

    # netstat -nlp | grep vnc

    发现vncserver在监听 5902端口

    这时运行 vncviewer, 访问 IP:5902, 成功,OK了。

  • 相关阅读:
    如何提取Redis中的大KEY
    VIM标记 mark 详解
    JAVA编写的一个简单的Socket实现的HTTP响应服务器
    onenote 直接发布文章到CSDN
    guava学习笔记--字符串处理
    带打印子结点的自底向上算法
    动态规划算法3
    动态规划算法2
    一个菜鸟学习动态规划算法的过程
    php取得当前时间函数
  • 原文地址:https://www.cnblogs.com/pinganzi/p/5541720.html
Copyright © 2020-2023  润新知