我正在尝试在全新安装的 CentOS 7 上为远程登录配置 VNC 服务器,但我似乎无法让它正常工作。
我已按照此处的安装步骤进行操作,包括 firewall-cmd 步骤,但是当我运行 systemctl status vncserver@:1.service 时,我看到:
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: inactive (dead) since <~4 seconds after start time>
Main PID: 1462 (code=exited, status=0/SUCCESS)
<start time> localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
<start time+3> localhost.localdomaind systemd[1]: Started Remote desktop service (VNC).
Run Code Online (Sandbox Code Playgroud)
当我尝试手动运行 vncserver(作为 su - remote-user)时,日志输出(在 /home/remote-user/.vnc/localhost.localdomain:1.log 中)是:
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
Killing Xvnc process ID 17085
Run Code Online (Sandbox Code Playgroud)
可能导致或促成问题的其他事情:
在 /etc/systemd/system/vncserver@:1.service 中,行:
PIDFile=/home/remote-user/.vnc/%H%i.pid
Run Code Online (Sandbox Code Playgroud)
似乎没有生成任何 .pid 文件。/home/remote-user/.vnc 不包含以 .pid 结尾的文件;这可能是因为 vnc 进程的寿命不足以创建它们,但我不确定。
只需检查您的/home/username/.vnc/xstartup文件并删除最后一行
这就是我的情况:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/etc/X11/xinit/xinitrc
vncserver -kill $DISPLAY
Run Code Online (Sandbox Code Playgroud)
vncserver -kill $DISPLAY绝对不是我们想要在 xstartup 中的东西,只需将其删除
| 归档时间: |
|
| 查看次数: |
11478 次 |
| 最近记录: |