From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 6AE2C1FF0B3 for ; Wed, 14 Oct 2026 16:17:53 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7F1392138C; Wed, 14 Oct 2026 16:17:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791987458; x=1792592258; darn=lists.proxmox.com; h=disposition-notification-to:thread-index:in-reply-to :content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:return-receipt-to:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wSvMlk7vHikpsh1ZTm8TPL1qRqXKRpDRl7pEFghADLc=; b=W0MI3JbmJ0lo4ghgoaIbQuhsyncDmndhAJuYVJEdW+oFqMh18o9Ub9rzpiaqtIx6gO duH0LJVeTs0YqnNLUiQfCpwAbFFKh5fSvnMIXZ0MU6pW/7QLcSdZQJ3Hxs7p5h1lshh9 3hNx8cB1xRNQf8n2uomHApexD4c6vmnudPnQ2OLY2sqqns6wyFva3PI/dA/uY1lGKTmY UN2ryud+7IFIxWq1TpO3FcqCcjqhTyAezqfI0zp6HcQMV8BAjOe0HgLqL49RM5jLUVOo uPsLWI6JC18hSYuqQnAsID2E5+kYZPnRYDrrvCMRES1UADtAu1NFvsn9Vx98K2TnxynQ K6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791987458; x=1792592258; h=disposition-notification-to:thread-index:in-reply-to :content-transfer-encoding:content-type:mime-version:message-id:date :subject:to:from:return-receipt-to:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wSvMlk7vHikpsh1ZTm8TPL1qRqXKRpDRl7pEFghADLc=; b=KplW610FNy+9zlD4Aay+gUQBF/rPDe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aWdCBiUzaXsCIO/xcN+ZukJN 6iBri5/UYqdmC4Dt2gtDZPEKCAO X-Received: by 2002:a5d:4287:0:b0:48a:fba3:d5b1 with SMTP id ffacd0b85a97d-48dbacf7bfamr24534735f8f.55.1791987457748; Wed, 14 Oct 2026 07:17:37 -0700 (PDT) From: "Dmitry R" To: "'DERUMIER, Alexandre'" , subject: SPAM: RE: [RFC] WebRTC console for VMs via QEMU's D-Bus display Date: Wed, 14 Oct 2026 17:19:38 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <30bceb85ccdffaa64be2221199f7193cb9699a01.camel@groupe-cyllene.com> Thread-Index: AQHdVXBGRf4eiR7QAEqLeEZZz5ArJ7byIEeAgArwHwCAABI1QA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-SPAM-LEVEL: Spam detection results: 3 AWL 0.250 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FORGED_GMAIL_RCVD 1 'From' gmail.com does not match 'Received' headers FREEMAIL_ENVFROM_END_DIGIT 1 Envelope-from freemail username ends in digit FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider GB_FREEMAIL_NUM 0.75 Freemail spammy address POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: DDFUTYAIN3X74XL7U4ESQKMPRSNMASPH X-Message-ID-Hash: DDFUTYAIN3X74XL7U4ESQKMPRSNMASPH X-MailFrom: rdmitry0911@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Alexandre, Thanks for your reply, and for making your patches available. I'm glad we can build on the same foundation. I'll work from your v2 series, first separating the shared qemu-server D-Bus display support from the console-specific parts. Then I'll rebase the WebRTC console onto that base, using the per-VM bus from your DBusDisplay.pm. I'll keep the media service in a separate package and preserve your authorship on the original patches. I'll also include the NVIDIA EGL readback fix I linked in my previous mail, keeping the existing VAAPI path available. My testing of that fix was limited to the capture/encoding adapter with output to a file; I still need to check it through the full Kyber console in the browser. I'll take the OpenGL 4.6 / Venus series you mentioned into account when rebasing. The shared base will still need feedback from the Proxmox developers on the configuration and integration. No problem about your availability. I'll send the revised patches to the list with you in Cc, so you can have a look when you have time. Thanks, Dmitry=20 -----Original Message----- From: DERUMIER, Alexandre [mailto:alexandre.derumier@groupe-cyllene.com] = Sent: Wednesday, October 14, 2026 4:12 PM To: pve-devel@lists.proxmox.com; rdmitry0911@gmail.com Subject: Re: [RFC] WebRTC console for VMs via QEMU's D-Bus display Hi Dmitry, Thanks for testing on nvidia, I didn't have hardware to test it. Feel free to rework my patches, I was waiting from proxmox devs review = && comments before doing more work. I was waiting for the merge of this patch too: [PATCH qemu-server/pve-manager/docs v4 0/1] add virtio-vga-gl OpenGL 4.6 & Vulkan (venus) support https://lore.proxmox.com/all/20260831094605.114396-1-m.frank@proxmox.com/= to rebase my serie. I'll be pretty busy at work until next month, so I'll don't have too = much time to work on it. but I'm glad that somebody is interested by me patch serie :) Best Regards, Alexandre Le mercredi 07 octobre 2026 =E0 17:10 +0300, Dmitry R a =E9crit=A0: >=20 > Hi all, hi Alexandre, > =A0 > only after sending this RFC I noticed that Alexandre posted "add rdp=20 > && kyber consoles for qemu over D-Bus display" in August [1]. Both=20 > proposals need the same foundation in qemu-server -- QEMU's D-Bus=20 > display -- and differ in what consumes it. Rather than two competing=20 > ways to enable it, I would suggest one shared base with the consoles=20 > on top. What the two series have in common: > =A0* qemu-server enables '-display dbus' for a VM, and a separate=20 > package attaches to it and streams the guest to the browser (RDP and=20 > Kyber daemons there, a WebRTC media service here); > =A0* with GL, QEMU refuses VNC and SPICE next to the D-Bus display, = so=20 > both have to deal with a VM that has no VNC console. Where they=20 > differ, and why I think Alexandre's base is the better one: > =A0* His series runs a private dbus-daemon per VM; mine uses = p2p=3Dyes=20 > and attaches every console with getfd + add_client. > =A0* With p2p=3Dyes, each add_client replaces the previous = connection, so=20 > only one consumer can be attached at a time. On a bus, RDP, Kyber and=20 > WebRTC can attach to the same VM side by side. > =A0* With p2p=3Dyes, QEMU 11.0 did not deliver audio in my tests: the = > AudioOutListener gets the Init/SetEnabled calls made while=20 > RegisterOutListener runs, then nothing (the same with a plain GDBus=20 > client, so it does not look like a problem of my listener). On a=20 > private bus, which my add-on uses today, both playback and the=20 > microphone (AudioInListener) work. > A possible split: > =A0=A0=A01. qemu-server: the per-VM D-Bus display (Alexandre's=20 > DBusDisplay.pm), the option that enables it, 'rendernode' for virtio-=20 > gl (bug #4771) and a 'dbus' driver for audio0. > =A0=A0=A02. One package per console, each attaching as a client on = that > bus: RDP and Kyber (Alexandre), WebRTC (mine, bug #8106), with their=20 > API calls and UI entries in qemu-server and pve-manager. > =A0 > I am happy to rebase the WebRTC part onto Alexandre's DBusDisplay.pm=20 > and drop my p2p attach and the separate 'dbus' VGA flag. Alexandre=20 > wrote that the DMA-BUF path is untested on NVIDIA, so I tried it on an = > RTX 3080 (driver 595.91, nvidia-vaapi-driver 0.0.16, QEMU 11.0, a=20 > virtio-vga-gl guest on a private per-VM bus; kyber-qemu-server and=20 > txproto built from the v2 patch against Debian trixie's FFmpeg 7.1,=20 > encoding to a file): > =A0 > - --dmabuf (h264_vaapi): QEMU hands over the scanout (XB24/AB24 with=20 > the NVIDIA block-linear modifier 0x300000000e08014), but the VAAPI=20 > frames context fails on the first frame -- "Failed to create surface: > 14 (the requested RT Format is not supported)" -- and nothing is=20 > encoded. With --encoder h264_nvenc it ends the same way, since the=20 > path goes through VAAPI whatever the encoder. > - The cause is the driver: on NVIDIA, VAAPI means nvidia-vaapi-=20 > driver, which only decodes (VAEntrypointVLD): no encoding, no video=20 > processing, no RGB surfaces. The mmap fallback would not help either,=20 > as a block-linear buffer does not read as linear memory. > - Without --dmabuf, the listener received no scanout at all from the=20 > GL display within 15 s (libx264 and h264_nvenc alike). > - Control on the same VM: my worker imports the same DMA-BUF with EGL=20 > (eglCreateImageKHR, EGL_LINUX_DMA_BUF_EXT with the modifier), reads it = > back with glReadPixels and encodes it with NVENC -- that works. So=20 > with a virtio-gl guest on NVIDIA, the Kyber console shows no picture=20 > today. > =A0 > A fix, tested [2]: a patch on top of v2 adds --dmabuf-readback to=20 > kyber-qemu-server (358 lines, mostly one new file, LGPL like=20 > dmabuf.c). It still requests DMA-BUF scanouts, imports each buffer=20 > with EGL (GBM platform, surfaceless context, the modifier passed),=20 > reads it back with glReadPixels and feeds your existing software path, = > so any --encoder works -- h264_nvenc on NVIDIA. A buffer is imported=20 > once and read only after QEMU reports damage. Same setup, a terminal=20 > running 'top -d 0.1' for 20 s: 1226 frames encoded with h264_nvenc, 0=20 > dropped, the picture correct; about 24% of one CPU core (36% with=20 > libx264). The --dmabuf path is unchanged; kycontroller could choose=20 > '--dmabuf-readback --encoder h264_nvenc' when the render node belongs=20 > to the nvidia driver. > =A0 > To be fair about the trade-off: the readback copies every changed=20 > frame into system memory, so on AMD and Intel your zero-copy VAAPI=20 > path is likely the more efficient one. The best of both would be=20 > zero-copy where VAAPI can import and encode, and the EGL readback=20 > everywhere else -- the same split would serve the WebRTC console. > =A0 > Maintainers: would one shared base series like this work for you, and=20 > is there a preferred name and place for the option that enables the=20 > D-Bus display? > [1] https://lore.proxmox.com/pve-devel/20260826074347.1256659-1- > alexandre.derumier@groupe-cyllene.com/ > [2] https://github.com/rdmitry0911/qsm-rd/blob/main/qsm- > direct/upstream/kyber-nvidia/0001-kyber-qemu-server-read-DMA-BUF- > scanouts-back-through.patch > =A0 > Thanks, > Dmitry >=20 > =A0 > From: Dmitry R [mailto:rdmitry0911@gmail.com] > Sent: Thursday, October 01, 2026 6:11 PM > To: pve-devel@lists.proxmox.com > Subject: [RFC] WebRTC console for VMs via QEMU's D-Bus display >=20 > Hi all, >=20 > I would like to ask whether a hardware-encoded WebRTC console for VMs=20 > would be welcome upstream, and if so, in which shape.=A0 It runs today = > as an add-on for PVE 9.2, and I have prepared the qemu-server and=20 > pve-manager parts as patch series against current master (tested on=20 > PVE 9.2 with an RTX 3080, see below) -- but I'd like your opinion on=20 > the design before sending them. >=20 > Feature request: bug #8106 > https://bugzilla.proxmox.com/show_bug.cgi?id=3D8106 >=20 > Motivation > ---------- > noVNC is the right console for firmware, installers and text consoles. > For time spent inside a running desktop it transfers changed=20 > rectangles instead of video, has no audio, and a VirGL (virtio-gl)=20 > guest reaches it through egl-headless readback.=A0 Measured with one=20 > guest image and the same workloads (method and raw numbers in the=20 > repository below): >=20 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 WebRTC, = virtio-gl =A0 noVNC, std VGA > =A0 720p video, pictures/s =A0 =A0 =A030 (source rate) =A0 =A07.4 > =A0 scrolling, pictures/s =A0 =A0 =A0 36 (52 on NVENC) =A0 =A012.0 > =A0 animated UI, pictures/s =A0 =A0 38 (45 on NVENC) =A0 =A011.0 > =A0 bandwidth, 720p video =A0 =A0 =A0 18.8 Mbit/s =A0 =A0 =A0 =A0 120 = Mbit/s > =A0 single pointer event =A0 =A0 =A0 =A088 ms =A0 =A0 =A0 =A0 =A0 =A0 = =A0 52 ms > =A0 console open -> 1st picture 3.4 s =A0 =A0 =A0 =A0 =A0 =A0 =A0 1.0 = s >=20 > The last two rows are where noVNC stays better: a single isolated=20 > event is one small rectangle for VNC, but a full encode/decode round=20 > trip for video (the 88 ms were measured with software libx264 on a=20 > CPU-only node).=A0 With NVENC (RTX 3080) the encoder used 4% while=20 > streaming the animated scene. >=20 > What QEMU already provides > -------------------------- > QEMU's D-Bus display (-display dbus) exports the guest scanout -- the=20 > GL/DMA-BUF scanout of virtio-gl included -- and takes keyboard, mouse, = > multi-touch, clipboard and audio.=A0 With p2p=3Dyes there is no bus > daemon: > a client is attached per connection through QMP (getfd + add_client),=20 > which PVE::QMPClient can already do (it passes the fd for getfd). >=20 > Proposed series > --------------- > 1. qemu-server: 'rendernode' for the VGA property > =A0 =A0 =A0vga: virtio-gl,rendernode=3D/dev/dri/renderD129 > =A0 =A0so a virtio-gl guest can be placed on a chosen GPU instead of = the > =A0 =A0first render node (fixes #4771).=A0 Small and useful on its = own. >=20 > 2. qemu-server: opt-in 'dbus' for the VGA property > =A0 =A0 =A0vga: virtio-gl,dbus=3D1 > =A0 =A0adds '-display dbus,p2p=3Dyes' (gl=3Don with the render node = for > =A0 =A0virtio-gl, gl=3Doff for the other types).=A0 One constraint: = with GL, > =A0 =A0QEMU refuses VNC and SPICE next to it ("Display vnc is = incompatible > =A0 =A0with the GL context"), so a virtio-gl VM with dbus=3D1 has = neither=20 > and > =A0 =A0offers the WebRTC console instead; non-GL types keep VNC as = well. > =A0 =A0The clipboard reaches the guest through qemu-vdagent (as for = the > =A0 =A0VNC clipboard) and the guest's spice-vdagent. > =A0 =A0Audio is not part of the series yet: the add-on plays it = through a > =A0 =A0bus-mode D-Bus display (a 'dbus' audiodev named in -display), = but > =A0 =A0with p2p=3Dyes our listener got no audio from QEMU 11.0 -- only = the > =A0 =A0Init/SetEnabled calls made while RegisterOutListener runs, = nothing > =A0 =A0afterwards.=A0 A 'dbus' audio0 driver is ready once that is = resolved. >=20 > 3. qemu-server: API call to attach a console > =A0 =A0 =A0POST /nodes/{node}/qemu/{vmid}/webrtcproxy =A0(VM.Console) > =A0 =A0takes the browser's SDP offer, creates a socketpair, attaches = one > =A0 =A0end to QEMU (getfd + add_client) and hands the other end with = the > =A0 =A0offer to a local media service over a root-owned unix socket > =A0 =A0(SCM_RIGHTS); returns the SDP answer.=A0 Authentication and ACL = stay > =A0 =A0exactly those of vncproxy/termproxy -- no extra port, no own = auth. > =A0 =A0The status API reports 'dbus' and 'vnc' so the UI knows which > =A0 =A0consoles a VM offers. >=20 > 4. pve-manager: WebRTC console type next to noVNC/SPICE/xterm.js > =A0 =A0in the console button and the VM's Console panel, offered when = the > =A0 =A0VM's display has dbus=3D1; the display editor gets the two = options. > =A0 =A0Like noVNC and xterm.js, the viewer itself is a page from a=20 > separate > =A0 =A0package that pveproxy serves ('?console=3Dkvm&webrtc=3D1'). >=20 > 5. A separate package with the media service: capture from the D-Bus > =A0 =A0display (the virtio-gl DMA-BUF scanout is imported through EGL = and > =A0 =A0read back; a zero-copy path to the encoder is future work), = encode > =A0 =A0(NVENC, VA-API, QSV; libx264 fallback; H.264, HEVC where the > =A0 =A0browser decodes it), > =A0 =A0Opus audio, WebRTC.=A0 Today it is C++ (FFmpeg) plus a = Python/aiortc > =A0 =A0WebRTC bridge; I realise Python/aiortc is unusual in your = stack. >=20 > Questions > --------- > - Is this something you would consider upstream at all? > - Property naming: 'rendernode' and 'dbus' inside 'vga', or a separate > =A0 display property? > - Would you rather keep the media service out of tree (users install > =A0 it, the API call returns an error when it is absent), or should it > =A0 eventually live in a Proxmox-maintained package, and would you = then > =A0 want it in Rust? > - Is 'webrtcproxy' next to 'vncproxy'/'termproxy' the right place? >=20 > Not part of this proposal: the prototype also has a graphical console=20 > for LXC containers (a headless compositor in the container with its=20 > own login screen, one console per tty like the terminal console).=A0 = It=20 > needs software inside the guest, so I plan to keep it as a separate=20 > add-on package. >=20 > Tested end to end on PVE 9.2 (qemu-server 9.2.7 and pve-manager > 9.2.11 plus the series): a Kubuntu 26.04 guest with > 'vga: virtio-gl,dbus=3D1' streams 1280x800 at 60 fps (NVENC H.264)=20 > through webrtcproxy, in a popup and in the VM's Console panel, for a=20 > user holding only PVEVMUser on the VM (403 without VM.Console). >=20 > Code and measurements: https://github.com/rdmitry0911/qsm-rd > (qsm-direct/, docs/COMPARISON.md for the numbers; the prepared series=20 > are in qsm-direct/upstream/patches/). >=20 > Transparency: I developed the prototype with the help of an AI coding=20 > assistant (Claude).=A0 I have reviewed and tested the code and will = sign=20 > the Harmony CLA; please tell me if that is a problem for you. >=20 > Thanks, > Dmitry