-1

我有一个虚拟机,我使用以下链接安装了 VNC 服务器 (TightVNC):https ://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18- 04

安装成功,可以看到5901端口正在运行

/etc/tigervnc$ netstat -tulpn
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      16460/Xtigervnc     
tcp        0      0 127.0.0.1:5902          0.0.0.0:*               LISTEN      16183/Xtigervnc     
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 ::1:5901                :::*                    LISTEN      16460/Xtigervnc     
tcp6       0      0 ::1:5902                :::*                    LISTEN      16183/Xtigervnc     
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                   
udp        0      0 0.0.0.0:36618           0.0.0.0:*                           -                   
udp    29184      0 127.0.0.53:53           0.0.0.0:*                           -                   
udp        0      0 0.0.0.0:68              0.0.0.0:*                           -                   
udp        0      0 0.0.0.0:631             0.0.0.0:*                           -                   
udp     7680      0 0.0.0.0:5353            0.0.0.0:*                           -                   
udp6       0      0 :::37372                :::*                                -                   
udp6   20736      0 :::5353                 :::*  

现在从我的本地机器上,我尝试从 VM 将端口绑定到我的本地(根据链接https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on -ubuntu-18-04 )

ssh -L 5901:127.0.0.1:5901 -C -N -l test 172.1.1.1

在我的本地机器上,我可以看到端口绑定到 5901

/etc/guacamole$ fuser 5901/tcp
5901/tcp:            22049

现在,当我尝试使用 127.0.0.1:5901 进行 VNC 连接时,它会提示输入 VM 的密码并仅显示空白页。

在此处输入图像描述

有人可以帮我解决这个问题吗?

谢谢,哈里

4

2 回答 2

-1

编辑你的 ~/.vnc/xstartup 文件:

#!/bin/sh

startxfce4 &

我有同样的问题,这解决了它

作为参考,我从这里得到它: https ://www.raspberrypi.org/forums/viewtopic.php?t=52557

于 2018-11-15T21:33:16.113 回答
-2

您也可以尝试杀死并重新启动您的 VNC 服务器

杀死 $(pgrep Xvnc) vncserver

您是否正在尝试从本地机器 VNC 到本地机器?我假设只是为了测试正确吗?

如果你没有被拒绝,至少它应该与服务交谈。

于 2018-11-15T22:16:00.867 回答