# 虚拟网络计算

**虚拟网络计算**（Virtual Network Computing，VNC）是一种远程显示系统：一台计算机上的查看器程序通过远程帧缓冲（Remote Framebuffer，RFB）协议，显示并控制另一台计算机上服务器程序的图形桌面。它由剑桥的奥利韦蒂-甲骨文研究实验室（Olivetti & Oracle Research Laboratory，ORL）创建，1998年由特里斯坦·理查森（Tristan Richardson）、昆汀·斯塔福德-弗雷泽（Quentin Stafford-Fraser）、肯尼思·R·伍德（Kenneth R. Wood）和[安迪·霍珀](https://www.edgepedia.org/zh/andy-hopper)（Andy Hopper）撰文描述。<sup>[1](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)</sup> 由于RFB工作在帧缓冲层面，即发送到视频输出的原始像素层面，它独立于操作系统、窗口系统和应用程序，Windows、Linux、macOS和Android上均有实现。<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup><sup> • </sup><sup>[3](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0207512&type=printable)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 在剑桥ORL开发；发表于《IEEE互联网计算》（IEEE Internet Computing）1998年1/2月号，同年以开源方式发布<sup>[1](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)</sup><sup> • </sup><sup>[4](https://vnc.com/open-source-vnc/)</sup> |
| 协议 | RFB，标准化为RFC 6143（2011年3月）；当前公布的版本为3.3、3.7和3.8<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup> |
| 传输 | 每个查看器一条TCP连接；服务器监听端口5900加显示编号，因此显示:1在5901上应答<sup>[5](https://vnc.com/how-does-vnc-work/)</sup> |
| 客户端模型 | 轻量且无状态：查看器不存储不可恢复的状态，因此断开后重新连接——甚至从不同设备连接——都能恢复同一会话<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup> |
| 编码 | 六种已定义的编码：Raw、CopyRect、RRE、Hextile、TRLE和ZRLE，按连接协商<sup>[5](https://vnc.com/how-does-vnc-work/)</sup> |
| 基线安全 | VNC身份验证使用16字节DES挑战，密码截断为八个字符；RFC 6143称其在密码学上薄弱<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup> |
| 实现 | RealVNC（商业），以及开源的TigerVNC、TightVNC、UltraVNC、TurboVNC、x11vnc、wayvnc和浏览器客户端noVNC<sup>[4](https://vnc.com/open-source-vnc/)</sup> |

## 起源

VNC源于ORL在瘦客户端架构上的工作。该实验室的传送系统（Teleporting System）已经能让运行中的X应用程序的用户界面重定向到另一台显示器，但X窗口系统带来了限制：它要求在显示机器上运行重量级的X服务器，其安全模型使远程显示的使用变得危险，而且在高延迟链路上应用程序启动缓慢。<sup>[1](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)</sup>

1994年，ORL制造了Videotile——一台带笔和ATM网络连接的LCD显示器，作为超瘦客户端的实验。将远程屏幕当作视频源来处理行得通，但占用大量带宽；在应用侧增加智能，只发送屏幕发生变化的部分，这一思路发展成了VNC协议。1995年Sun发布alpha版Java语言和HotJava浏览器时，ORL用Java实现了该机制，用一天时间写出了原始客户端——一个6 KB的类文件，后来成为VNC小程序。<sup>[1](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)</sup> 该系统于1998年由剑桥团队以开源方式发布。<sup>[4](https://vnc.com/open-source-vnc/)</sup>

ORL本身在该技术发布前后几经易手：1997年与甲骨文的联合资助安排使其成为奥利韦蒂-甲骨文研究实验室，1999年1月被AT&T收购，成为AT&T剑桥实验室。<sup>[6](https://www.cl.cam.ac.uk/research/dtg/attarchive/)</sup>

## 协议如何工作

一个VNC会话是两个程序加一条TCP连接。服务器运行在被控制的机器上，拥有其屏幕——可以是它创建的虚拟显示，也可以是已在运行的物理显示。查看器运行在用户所在处，请求屏幕矩形并绘制返回的像素，而击键和鼠标移动则沿同一条连接反向传输。<sup>[5](https://vnc.com/how-does-vnc-work/)</sup>

协议的显示侧建立在一个图形原语上：在给定的x、y坐标处放置一个像素数据矩形。该像素数据的编码方案是协商确定的，在网络带宽、客户端绘制速度和服务器处理速度之间权衡。Raw编码按从左到右的扫描线顺序发送像素，每个客户端和服务器都必须支持它；CopyRect则发送一个x、y坐标，告诉查看器复制它已经持有的像素，适合窗口移动和滚动。<sup>[1](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)</sup> RFC 6143中定义的六种编码是Raw、CopyRect、RRE、Hextile、TRLE和ZRLE；ZRLE用zlib压缩64×64的瓦片，TigerVNC的查看器在开启自动选择时会请求Tight扩展编码，该编码增加了JPEG压缩。<sup>[5](https://vnc.com/how-does-vnc-work/)</sup>

一个连接经过三个阶段。第一，服务器以12字节字符串（如`RFB 003.008\n`）发送其支持的最高协议版本，查看器回复双方将使用的版本，服务器列出其支持的安全类型供查看器选择。第二，初始化：查看器发送ClientInit，服务器以ServerInit应答，描述帧缓冲、像素格式和桌面名称。第三，正常交互循环：查看器发送FramebufferUpdateRequest消息，指定屏幕矩形；由于查看器保留自己的帧缓冲副本，服务器通常只回复变更部分。在基线协议中，服务器仅在收到请求时发送更新，因此由查看器决定节奏；TigerVNC的持续更新等扩展则允许服务器无需等待即可推送变更。<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup><sup> • </sup><sup>[5](https://vnc.com/how-does-vnc-work/)</sup>

**端口与寻址。** 服务器监听TCP端口5900加其显示编号：显示:1在5901上应答，:2在5902上应答。绑定到所有地址的服务器直接接受查看器；绑定到localhost的服务器仅接受来自本机的连接，远程查看器通过SSH隧道接入。<sup>[5](https://vnc.com/how-does-vnc-work/)</sup> 对于通过互联网的直接连接，必须允许该端口通过设备防火墙的入站流量，并在路由器上转发；RealVNC建议互联网使用时采用其云连接服务而非直接连接，这样就不需要做路由器端口转发。<sup>[7](https://help.realvnc.com/hc/en-us/articles/38538874117533-RealVNC-Viewer-and-Server-Basics)</sup><sup> • </sup><sup>[8](https://www.realvnc.com/en/developer/security/)</sup>

## 安全

RFC 6143中定义的RFB协议除了可选的VNC身份验证密码检查外不提供任何安全性，RFC称该检查在密码学上薄弱，不适用于不受信任的网络；它不提供对数据流被观察或篡改的保护。该文档建议在IPsec或SSH等加密通道上运行会话，或商定加密会话的扩展安全类型。<sup>[2](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)</sup> 在基线身份验证中，服务器发送16字节挑战，查看器以密码为密钥用DES加密它，密码截断为八个字符或用空字节填充。<sup>[5](https://vnc.com/how-does-vnc-work/)</sup>

各实现增加了更强的选项。TigerVNC的Xvnc默认使用TLSVnc安全类型，即无证书的匿名TLS，配置证书后可使用X.509类型。<sup>[9](https://vnc.com/vendors/servers/)</sup> RealVNC Connect默认以至少128位AES-GCM加密每个连接，并有256位AES选项。<sup>[10](https://www.realvnc.com/en/vnc-viewer-comparison/)</sup>

**大规模暴露。** 2026年，Forescout Vedere Labs发现160万台VNC服务器可在线访问，另有180万台RDP服务器，其中很大一部分运行过时的Windows版本；在许多可公开访问的VNC服务器上，身份验证已被关闭，以至于任何用户都可以与设备显示的应用进行交互。在已分类的暴露服务器中，28%的VNC服务器属于教育行业，22%属于服务业。<sup>[11](https://www.itpro.com/security/researchers-warn-millions-of-rdp-and-vnc-servers-are-wide-open-to-exploitation)</sup>

基于VNC的服务也带有平台漏洞。macOS屏幕共享（Screen Sharing）是macOS内置的基于VNC的远程桌面服务，监听TCP端口5900，默认禁用；Apple在2026年修补了一个漏洞，该漏洞允许网络上的攻击者无需有效凭据即可通过屏幕共享进行身份验证；另一个独立漏洞影响了启用了传统“VNC查看器可使用密码控制屏幕”选项的Mac。<sup>[12](https://www.tomshardware.com/tech-industry/cyber-security/macos-screen-sharing-flaw-exploited-to-root-macs-and-plant-monero-miners)</sup><sup> • </sup><sup>[13](https://www.techradar.com/pro/security/a-potentially-dangerous-macos-security-flaw-went-unreported-due-to-apple-being-deluged-by-ai-slop-bug-reports)</sup>

## 实现

原始代码及其衍生代码与独立实现一起构成了一个实现家族。<sup>[4](https://vnc.com/open-source-vnc/)</sup>

- **RealVNC**是创建VNC的团队的商业延续；RealVNC Connect 8提供基于连接码的临时控制和长期设备注册，RealVNC声称超过十亿台设备运行其软件。<sup>[14](https://www.itpro.com/mobile/remote-access/368061/8-best-teamviewer-alternatives)</sup>
- **TigerVNC**是基于RealVNC 4和X.org代码库的高速版本。它最初是TightVNC在Unix和Linux上的下一代开发工作，2009年初从父项目分离，以便TightVNC可以专注于Windows。它采用GPL-2.0许可，支持由libjpeg-turbo JPEG编解码器加速的Tight编码变体。<sup>[15](https://github.com/TigerVNC/tigervnc)</sup>
- **TightVNC**在GPL-2.0下提供Windows服务器和查看器。<sup>[4](https://vnc.com/open-source-vnc/)</sup>
- **UltraVNC**是一个GPL-3.0-or-later的Windows服务器；通过配置的DSM插件可选用加密，服务器默认没有插件。<sup>[9](https://vnc.com/vendors/servers/)</sup>
- **noVNC**在MPL-2.0下为浏览器实现RFB，需要支持WebSocket的服务器或[WebSocket](https://www.edgepedia.org/zh/websocket)到TCP的代理。<sup>[4](https://vnc.com/open-source-vnc/)</sup>
- **x11vnc**共享现有的X11显示，**wayvnc**服务于基于wlroots的Wayland合成器。<sup>[4](https://vnc.com/open-source-vnc/)</sup>

各服务器的会话模型不同。TigerVNC通过Xvnc提供虚拟X会话，通过x0vncserver提供现有X显示，通过w0vncserver提供Wayland显示；RealVNC Server的服务模式远程控制控制台，而其虚拟模式创建一个私有桌面。<sup>[9](https://vnc.com/vendors/servers/)</sup><sup> • </sup><sup>[5](https://vnc.com/how-does-vnc-work/)</sup>

## VNC与RDP的比较

VNC和同样于1998年发布的微软远程桌面协议（RDP），以不同方式解决同一问题。RFB从帧缓冲传输像素，客户端请求屏幕上不同部分的更新；RDP在可能时传输图形界面函数调用而非位图，减少流量，并支持多个并行通道用于不同的数据流。<sup>[3](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0207512&type=printable)</sup> 在2019年PLOS ONE上关于桌面即服务远程桌面协议的比较中，VNC（RFB）与RDP、Citrix ICA、PCoIP和[TeamViewer](https://www.edgepedia.org/zh/teamviewer)一起部署，结果显示不同协议和用户配置在视频质量、交互性和链路带宽之间的权衡。<sup>[3](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0207512&type=printable)</sup>

## References

1. [Tristan Richardson, Quentin Stafford-Fraser, Kenneth R. Wood, and Andy Hopper (1998). Virtual Network Computing. IEEE Internet Computing.](https://www.cl.cam.ac.uk/research/dtg/attarchive/pub/docs/att/tr.98.1.pdf)
2. [T. Richardson and J. Levine (2011). RFC 6143: The Remote Framebuffer Protocol. IETF.](https://www.rfc-editor.org/rfc/rfc6143.html?format=txt)
3. [Remote access protocols for Desktop-as-a-Service solutions. PLOS ONE (2019).](https://journals.plos.org/plosone/article/file?id=10.1371%2Fjournal.pone.0207512&type=printable)
4. [Open Source VNC. VNC.com.](https://vnc.com/open-source-vnc/)
5. [How Does VNC Work? A Viewer, a Server and One TCP Connection. VNC.com.](https://vnc.com/how-does-vnc-work/)
6. [AT&T Laboratories Cambridge. Cambridge University Computer Laboratory.](https://www.cl.cam.ac.uk/research/dtg/attarchive/)
7. [RealVNC Viewer and Server Basics. RealVNC Help Center.](https://help.realvnc.com/hc/en-us/articles/38538874117533-RealVNC-Viewer-and-Server-Basics)
8. [Security. RealVNC.](https://www.realvnc.com/en/developer/security/)
9. [VNC servers by platform and session model. VNC.com.](https://vnc.com/vendors/servers/)
10. [VNC Viewer Comparison. RealVNC.](https://www.realvnc.com/en/vnc-viewer-comparison/)
11. [Researchers warn millions of RDP and VNC servers are wide open to exploitation. IT Pro (2026).](https://www.itpro.com/security/researchers-warn-millions-of-rdp-and-vnc-servers-are-wide-open-to-exploitation)
12. [Critical macOS Screen Sharing flaw gives attackers remote root access. Tom's Hardware (2026).](https://www.tomshardware.com/tech-industry/cyber-security/macos-screen-sharing-flaw-exploited-to-root-macs-and-plant-monero-miners)
13. [A potentially dangerous macOS security flaw went unreported due to Apple being deluged by AI slop bug reports. TechRadar (2026).](https://www.techradar.com/pro/security/a-potentially-dangerous-macos-security-flaw-went-unreported-due-to-apple-being-deluged-by-ai-slop-bug-reports)
14. [The best TeamViewer alternatives. IT Pro (2025).](https://www.itpro.com/mobile/remote-access/368061/8-best-teamviewer-alternatives)
15. [TigerVNC/tigervnc: High performance, multi-platform VNC client and server. GitHub.](https://github.com/TigerVNC/tigervnc)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Networking fundamentals and architecture

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/virtual-network-computing

English original: https://www.edgepedia.org/virtual-network-computing
