AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1461991
Accepted
lampShadesDrifter
lampShadesDrifter
Asked: 2019-07-20 18:13:11 +0800 CST2019-07-20 18:13:11 +0800 CST 2019-07-20 18:13:11 +0800 CST

TigerVNC 服务器服务启动失败

  • 772

根据这篇文章,尝试在 centos7 机器上安装 TigerVNC 以进行远程 dektop 访问(作为 root)。有以下配置

[root@HW01 ~]# cat /etc/systemd/system/vncserver@:1.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/[email protected]
# 2. Replace <USER> with the actual user name and edit vncserver
#    parameters appropriately
#    (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
#     PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.


[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[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 || :'

[Install]
WantedBy=multi-user.target

做过...

[root@HW01 ~]# vncpasswd
Password:
Password not changed
[root@HW01 ~]#

确认 root 没有密码,但出现以下错误...

[root@HW01 ~]# 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@HW01 ~]# systemctl status vncserver@:1.service
● 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 Fri 2019-07-19 16:03:11 HST; 14s ago
  Process: 72135 ExecStart=/usr/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=1/FAILURE)
  Process: 72129 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)

Jul 19 16:03:11 HW01.ucera.local systemd[1]: Starting Remote desktop service (VNC)...
Jul 19 16:03:11 HW01.co.local runuser[72135]: Password:
Jul 19 16:03:11 HW01.co.local systemd[1]: vncserver@:1.service: control process exited, cod...s=1
Jul 19 16:03:11 HW01.co.local systemd[1]: Failed to start Remote desktop service (VNC).
Jul 19 16:03:11 HW01.co.local systemd[1]: Unit vncserver@:1.service entered failed state.
Jul 19 16:03:11 HW01.co.local systemd[1]: vncserver@:1.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

任何人都知道这里可能出了什么问题?任何调试建议?

centos-7 vnc
  • 1 1 个回答
  • 22723 Views

1 个回答

  • Voted
  1. Best Answer
    lampShadesDrifter
    2019-07-23T14:45:26+08:002019-07-23T14:45:26+08:00

    根据 RHEL7论坛上的帖子和之前链接的文章,问题似乎是我没有为用户重置 vncpasswd(我之前故意不这样做,因为我想将密码保留为空(看来这是不可能的或者我误解了 vncpasswd 真正在做什么))。所以这样做...

    在此处输入图像描述

    ...从启动服务之前的文章帮助解决了问题。

    [root@HW04 ~]# vncpasswd
    Password:
    Verify:
    Would you like to enter a view-only password (y/n)? n
    A view-only password is not used
    [root@HW04 ~]# systemctl start vncserver@:1.service
    [root@HW04 ~]# systemctl status vncserver@:1.service
    ● vncserver@:1.service - Remote desktop service (VNC)
       Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
       Active: inactive (dead) since Mon 2019-07-22 12:39:17 HST; 5min ago
      Process: 2170 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
      Process: 2125 ExecStart=/usr/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
      Process: 2122 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
     Main PID: 2143 (code=exited, status=0/SUCCESS)
    
    Jul 22 12:39:09 HW04.co.local systemd[1]: Starting Remote desktop service (VNC)...
    Jul 22 12:39:17 HW04.co.local systemd[1]: Started Remote desktop service (VNC).
    
    • 2

相关问题

  • Google-chrome --headless --disable-gpu 在 Centos 上出现网络错误

  • 以批处理模式应用顶级过滤器

  • systemctl 无法启动服务(代码=退出状态=0/成功)

  • 命令提示符 netstat 响应

  • Centos 7 日期用加号显示当前时间

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve