默认只接受 localhost 连接,需显式传 0.0.0.0 才对外监听;neatvnc 和 aml 需自行克隆并软链到 subprojects 目录;启用 TLS 或 RSA-AES 前需先生成密钥与证书并写进配置文件。
meson build
ninja -C build
./build/wayvncREADME 未说明具体显存或 GPU 型号要求;仅要求运行在 wlroots 系 Wayland 合成器上,Gnome、KDE、Weston 不支持,无头会话也可运行。
给 wlroots 系 Wayland 合成器用的 VNC 服务器,把运行中的会话通过 RFB 协议共享出去
为基于 wlroots 的 Wayland 合成器提供 VNC 服务端,让 Sway 等桌面能被标准 VNC 客户端远程访问和控制。
核心能力
- 附着到运行中的 Wayland 会话并创建虚拟输入设备
- 通过 RFB 协议暴露单个显示,支持无头会话
- 支持 VeNCrypt(TLS) 与 RSA-AES 认证加密
- 提供 wayvncctl 控制套接字,用 JSON IPC 查询与控制
- 可生成自签名证书并配合 SSH 隧道使用
容易踩的坑
- v0.10.2最新正式版2026-09-25 · 2026-09-25 09:16 UTC
This is a bugfix release that fixes a few resource cleanup issues. This should prevent some crashes.
Andri Yngvason (7): main: Point VNC display to correct image source on switch ctl-server: Flush on stop main: Add image_source NULL check in client_destroy ctl-client: Stop reconnect loop when no longer waiting for events main: Clear display image source when no outputs left main: Clear self->nvnc on init failure Release v0.10.2 - v0.10.12026-07-09 · 2026-07-09 18:52 UTC
查看更新说明
This patch release fixes typos in the man page, string truncation issues in the control ipc code and various issues with detached mode.
Shortlog
Andri Yngvason (9): main: Defer detach when last output goes away main: Cancel deferred detach on output added main: Remove extraneous nvnc_remove_display main: Fix output image source type check main: Bail early if attach fails json-ipc: Truncate vsnprintf output length json-ipc: Bump jvprintf's buffer to 256 output: Treat failed power state as ON Release v0.10.1 Olivia Lee (1): man: Fix typo in private_key_file config docs dmotte (1): man: Fix some typos and formatting issues - v0.10.02026-04-28 · 2026-04-28 08:48 UTC
查看更新说明
Highlights
- Multiple outputs can now be captured using the
--desktopflag. They will all be composited into one large framebuffer based on the compositor's layout. - It is now possible to listen on multiple endpoints by setting multiple listening addresses. See the man page for more information.
- A custom desktop name can now be set thanks to Attila Fidan. The desktop name is usually displayed in the title bar or the VNC client.
- Legacy DES authentication has been implemented by Andrian Budantsov along with support for older versions including 3.3 and 3.7. This allows people to connect using legacy software such as Remote Desktop on Mac OS.
- The forward and back mouse buttons should now work on clients that support them.
Shortlog
Andri Yngvason (119): meson: Bump version to 0.10-dev main: Use new neatvnc listen api option-parser: Add repeating positional arguments main: Implement multi-address listening main: Accept multiple addresses from config buffer: Require environment variable to enable CMA ext-image-copy-capture: Check for buffer allocation failure pointer: Add forward and back buttons Provide more thorough bug-report instructions Fix typo in bug report template main: Improve deinitialisation order Return error in output control commands when detached Use aml v1 data-control: Demote 0-length error to debug message ext-image-copy-capture: Only keep session while capturing Validate log-level and fix verbose option screencopy: Remove average capture delay Remove exponential smoother screencopy: Use start time for rate limit ext-image-copy-capture: Simplify rate limiting main: Add global rate limiter main: Add a comment to explain rate limiting Clear cursor when screen blanking meson: Use new pkgconfig for aml1 keyboard: Implement multiple layouts ext-image-copy-capture: Calculate correct stride Introduce abstract image-source for capturing Implement toplevel capture Remove output dimension change callback output: Remove unused code Move point transform function Fall back to using last frame for dimensions Bundle sys/queue.h Implement observer pattern image-source: Use observer for power_change image-source: Remove output-added notifier toplevel: Make impl static Add multi-output desktop capture output: Make output_destroy alias for image_source_destroy screencopy: Make starts idempotent main: Add log-filter option screencopy: Turn caps into method man: Add new options output: Use logical width & height main: Set logical size on nvnc displays Extract wayland connection class from main buffer: Make wl_buffer inert on detach image-source: Add geometry change observable main: Observe desktop dimension changes image-source: Add destroyed observable main: Remove nvnc displays when outputs disappear main: Add new nvnc displays when outputs appear output: Add method to get last output in list main: Allow resizing single output desktop main: Use transformed dimension in geometry change handler main: Use correct desktop output dimensions buffer: Unlink destroyed pool from inflight buffers main: Remove exit on capture failure main: Only exit when there are no desktop outputs left desktop: Make sc inert when desktop is destroyed main: Fix sc and image source resource management issues Remove buffer domains main: Fix null-pointer dereference in desktop_output_destroyed main: Add missing error check for wayland_connect Consolidate wayland attach & detach desktop: Implement cursor capture main: Pass display to ini - Multiple outputs can now be captured using the
- v0.9.12024-11-20 · 2024-11-20 22:53 UTC
查看更新说明
This release fixes buffer allocation on FreeBSD.
- v0.9.02024-11-19 · 2024-11-19 11:20 UTC
查看更新说明
Highlights
- The new ext-image-copy-capture-v1 protocol has been implemented for output capturing.
- A file descriptor created by a parent process can be used for listening for new connections, thanks to Attila Fidan.
- Clipboard handling has been made more robust, thanks again to Attila Fidan.
- WayVNC can now allocate CMA backed pixel buffers. They are required for hardware encoding on Raspberry Pi.
- Keyboard LED state can be passed to clients.
See Neat VNC's release notes for more highlights.
Bug fixes
- Output power management is now only enabled while capturing.
Acknowledgments
Special thanks go to Raspberry Pi Ltd. for sponsoring some of the work that's gone into this release. If you run a business and would like to accelerate the development of this project, feel free to contact me.
Shortlog
Andri Yngvason (61): README: Use ECDSA instead of RSA ctl: Emit event when output is added/removed meson: Bump version to 0.9 buffer: Allocate DMA-BUFs via CMA where available util: Add ALIGN_UP macro buffer: Align CMA buffers up to nearest multiple of 16 FUNDING.yml: Add github sponsors test: integration: Disable multi-output test buffer: Only include linux/dma-heap.h where available README: Update builds.sr.ht badge path keyboard: Pass keyboard LED state to client Initialise VNC last buffer: Fix dma head feature guard macros Fix show-performance option name Manage power only during capturing table-printer: Make left column width constant main: Make external-listener-fd option boolean ctl-client: Remove unused code buffer: Create a global buffer registry Move calculate_region_area to pixels.c Create abstract screencopy interface Implement ext-image-copy-capture-v1 protocols: Add ext-foreign-toplevel-list-v1 ext-image-copy-capture: Remove bogus header Use render node supplied by ext-image-copy-capture buffer: Save render node device id into buffer ext-image-copy-capture: Pass modifiers ext-image-copy-capture: Release pointer object after use Clean up various memory leaks README: Update sr.ht build status badge buffer: Remove use of major()/minor() .gitignore: Add sandbox directory cfg: Fix double-free on failure buffer: Keep gbm device alive while buffer lives output-management: Destroy config head objects ext-image-copy-capture: Add pts buffer: Fix build with disable dmabuf image-copy-capture: Fix unused variable warning main: Remove unused variable main: Fix show-performance option Order command line options by the alphabet Add option to disable resizing buffer: Fix copying of modifiers from config buffer: Pass multi-planar buffers to compositor buffer: Fix error check in gbm device creation buffer: Log a debug message when reconfiguring ext-image-copy-capture: Select optimal format & modifier ext-image-copy-capture: Split buffer config into smaller functions ext-image-copy-capture: Check if preferred format changed on every frame ext-image-copy-capture: Remove superfluous logging Add missing ifdefs for screencopy-dmabuf man: Alphabetise options man: Add missing command line options output-management: Fix unused variable warning in release build ext-image-copy-capture: Fix unused variable warning in release build meson: Fix deprecation warnings man: Fix repeated words buffer: Fix result type in find_render_node buffer: Don't open render node for shm ext-image-copy-capture: Fall back to SHM if DMA-BUF pool config fails main: Stop capture retry timer when detaching Attila Fidan (16):
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
wayvnc
Introduction
This is a VNC server for wlroots-based Wayland compositors (:no_entry: Gnome, KDE and Weston are not supported). It attaches to a running Wayland session, creates virtual input devices, and exposes a single display via the RFB protocol. The Wayland session may be a headless one, so it is also possible to run wayvnc without a physical display attached.
Please check the FAQ for answers to common questions. For further support, join the #wayvnc IRC channel on libera.chat, or ask your questions on the GitHub discussion forum for the project.
Building
Runtime Dependencies
- aml
- drm
- gbm (optional)
- libxkbcommon
- neatvnc
- pam (optional)
- pixman
- jansson
Build Dependencies
- GCC
- meson
- ninja
- pkg-config
For Arch Linux
pacman -S base-devel libglvnd libxkbcommon pixman gnutls jansson
For Fedora 37
dnf install -y meson gcc ninja-build pkg-config egl-wayland egl-wayland-devel \
mesa-libEGL-devel mesa-libEGL libwayland-egl libglvnd-devel \
libglvnd-core-devel libglvnd mesa-libGLES-devel mesa-libGLES \
libxkbcommon-devel libxkbcommon libwayland-client \
pam-devel pixman-devel libgbm-devel libdrm-devel scdoc \
libavcodec-free-devel libavfilter-free-devel libavutil-free-devel \
turbojpeg-devel wayland-devel gnutls-devel jansson-devel
For Debian (unstable / testing)
apt build-dep wayvnc
For Ubuntu
apt install meson libdrm-dev libxkbcommon-dev libwlroots-dev libjansson-dev \
libpam0g-dev libgnutls28-dev libavfilter-dev libavcodec-dev \
libavutil-dev libturbojpeg0-dev scdoc
Additional build-time dependencies
The easiest way to satisfy the neatvnc and aml dependencies is to link to them in the subprojects directory:
git clone https://github.com/any1/wayvnc.git
git clone https://github.com/any1/neatvnc.git
git clone https://github.com/any1/aml.git
mkdir wayvnc/subprojects
cd wayvnc/subprojects
ln -s ../../neatvnc .
ln -s ../../aml .
cd -
mkdir neatvnc/subprojects
cd neatvnc/subprojects
ln -s ../../aml .
cd -
Configure and Build
meson build
ninja -C build
To run the unit tests:
meson test -C build
To run the integration tests:
./test/integration/integration.sh
Running
Wayvnc can be run from the build directory like so:
./build/wayvnc
:radioactive: The server only accepts connections from localhost by default. To
accept connections via any interface, set the address to 0.0.0.0 like this:
./build/wayvnc 0.0.0.0
:warning: Do not do this on a public network or the internet without user authentication enabled. The best way to protect your VNC connection is to use SSH tunneling while listening on localhost, but users can also be authenticated when connecting to wayvnc.
Encryption & Authentication
VeNCrypt (TLS)
For TLS, you'll need a private X509 key and a certificate. A self-signed key with a certificate can be generated like so:
cd ~/.config/wayvnc
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -sha384 \
-days 3650 -nodes -keyout tls_key.pem -out tls_cert.pem \
-subj /CN=localhost \
-addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1
cd -
Replace localhost and 127.0.0.1 in the command above with your public facing
host name and IP address, respectively, or just keep them as is if you're
testing locally.
Create a config with the authentication info and load it using the --config
command line option or place it at the default location
$HOME/.config/wayvnc/config.
use_relative_paths=true
address=0.0.0.0
enable_auth=true
username=luser
password=p455w0rd
private_key_file=tls_key.pem
certificate_file=tls_cert.pem
RSA-AES
The RSA-AES security type combines RSA with AES in EAX mode to provide secure authentication and encryption that's resilient to eavesdropping and MITM. Its main weakness is that the user has to verify the server's credentials on first use. Thereafter, the client software should warn the user if the server's credentials change. It's a Trust on First Use (TOFU) scheme as employed by SSH.
For the RSA-AES to be enabled, you need to generate an RSA key. This can be achieved like so:
ssh-keygen -m pem -f ~/.config/wayvnc/rsa_key.pem -t rsa -N ""
You also need to tell wayvnc where this file is located, by setting setting the
rsa_private_key_file configuration parameter:
use_relative_paths=true
address=0.0.0.0
enable_auth=true
username=luser
password=p455w0rd
rsa_private_key_file=rsa_key.pem
You may also add credentials for TLS in combination with RSA. The client will choose.
DES Authentication (Legacy)
:warning: DES authentication provides no encryption of the VNC session. It uses an outdated challenge-response scheme where only the first 8 characters of the password are used. This is not secure by any modern standard.
This option exists solely for compatibility with VNC clients that support DES but do not support the absence of authentication, such as macOS Screen Sharing.
If you need to support such clients, add the following to your config:
enable_auth=true
password=p455w0rd
relax_encryption=true
allow_broken_crypto=true
DES authentication does not work when enable_pam is enabled, as PAM overrides
password-based authentication.
On a network you do not fully trust, use SSH tunneling or a VPN to provide encryption.
wayvncctl control socket
To facilitate runtime interaction and control, wayvnc opens a unix domain socket at $XDG_RUNTIME_DIR/wayvncctl (or a fallback of /tmp/wayvncctl-$UID). A client can connect and exchange json-formatted IPC messages to query and control the running wayvnc instance.
Use the wayvncctl utility to interact with this control socket from the
command line.
See the wayvnc(1) manpage for an in-depth description of the IPC protocol and
the available commands, and wayvncctl(1) for more on the command line
interface.
There is also a handy event-loop mode that can be used to run commands when various events occur in wayvnc. See examples/event-watcher for more details.