我在 CentOS Linux(7.7.1908 版)上安装了tigervnc-server。
我成功配置并启用了 VNC 服务,但是,正在运行
sudo 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: resources) since Thu 2019-10-10 13:57:15 +03; 34s ago
Process: 1379 ExecStart=/usr/sbin/runuser -l user-1 -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
Process: 1291 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Oct 10 13:57:09 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Oct 10 13:57:15 localhost.localdomain systemd[1]: New main PID 1779 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 13:57:15 localhost.localdomain systemd[1]: New main PID 1779 does not belong to service, and PID file is not owned by root. Refusing.
Oct 10 13:57:15 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Oct 10 13:57:15 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state.
Oct 10 13:57:15 localhost.localdomain systemd[1]: vncserver@:1.service failed.
我可以看到 VNC 服务器正在运行:
ps aux | grep vnc
user+ 1779 0.2 0.7 184456 30936 ? S 13:57 0:00 /usr/bin/Xvnc :1 -auth /home/user-1/.Xauthority -desktop localhost.localdomain:1 (user-1) -fp catalogue:/etc/X11/fontpath.d -geometry 1920x1080 -pn -rfbauth /home/user-1/.vnc/passwd -rfbport 5901 -rfbwait 30000
user+ 1895 0.0 0.0 113184 1184 ? S 13:57 0:00 /bin/sh /home/user-1/.vnc/xstartup
我也可以通过 VNC 客户端连接到机器,但屏幕分辨率没有更改为 1920x1080。
什么会导致这样的问题?
我找到了这个链接,它解释了 systemd 发生了一些变化,所以这很可能是问题出在哪里。
https://community.oracle.com/thread/4286364
我已经从我的 vncserver@:x 文件中删除了引用 pid 的行,并且不再收到错误报告,尽管 pid 仍然报告错误。希望很快会有修复。
希望这对您有所帮助,并可以解决您的问题