我正在运行带有三个客户端虚拟机的 KVM 主机。两个 ubuntu 服务器和一个 windows server r2 2008。
所有三台虚拟机都在其 XML 配置文件中启用了 VNC 选项:
<graphics type='vnc' port='5910' autoport='no' listen='0.0.0.0' keymap='de'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<graphics type='vnc' port='5911' autoport='no' listen='0.0.0.0' keymap='de'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<graphics type='vnc' port='5912' autoport='no' listen='0.0.0.0' keymap='de'>
<listen type='address' address='0.0.0.0'/>
</graphics>
并且在启动时打开给定的端口:
user@kvm-host:~$ netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1061/rpcbind
tcp 0 0 192.168.100.1:53 0.0.0.0:* LISTEN 2811/dnsmasq
tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN 1844/beam
tcp 0 0 0.0.0.0:5910 0.0.0.0:* LISTEN 4497/qemu-system-x8
tcp 0 0 0.0.0.0:40758 0.0.0.0:* LISTEN 1844/beam
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1680/sshd
tcp 0 0 0.0.0.0:5911 0.0.0.0:* LISTEN 4532/qemu-system-x8
tcp 0 0 0.0.0.0:5912 0.0.0.0:* LISTEN 2844/qemu-system-x8
tcp 0 0 0.0.0.0:5280 0.0.0.0:* LISTEN 1844/beam
tcp 0 0 0.0.0.0:5281 0.0.0.0:* LISTEN 1844/beam
tcp 0 0 0.0.0.0:38724 0.0.0.0:* LISTEN 1131/rpc.statd
tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 1844/beam
tcp6 0 0 :::111 :::* LISTEN 1061/rpcbind
tcp6 0 0 :::4369 :::* LISTEN 1753/epmd
tcp6 0 0 :::22 :::* LISTEN 1680/sshd
tcp6 0 0 :::52896 :::* LISTEN 1131/rpc.statd
我已经向 iptables 添加了一条规则:
sudo iptables -L
ACCEPT tcp -- anywhere anywhere tcp dpt:5911
ACCEPT tcp -- anywhere anywhere tcp dpt:5910
ACCEPT tcp -- anywhere anywhere tcp dpt:5912
但我无法通过 vnc 远程连接!我可以通过 telnet 连接到本地主机的 5910 端口。本地 telnet 连接返回 RFB 003.008。但从外部连接时,连接超时。
我能做些什么?