From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 861261FF0DF for ; Thu, 05 Nov 2026 15:58:10 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D036F215DA; Thu, 05 Nov 2026 15:58:05 +0100 (CET) Message-ID: <72f14ab1-2440-49b2-8bfc-54d3093c2f88@proxmox.com> Date: Thu, 5 Nov 2026 15:57:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [pve-devel] [PATCH container] add container console scrollback buffer From: Filip Schauer To: Thomas Ellmenreich , Proxmox VE development discussion , Elias Huhsovitz References: <20260121112335.84473-1-f.schauer@proxmox.com> <7788afcb-4ca0-4189-9fb9-001a6c9dad78@proxmox.com> Content-Language: en-US In-Reply-To: <7788afcb-4ca0-4189-9fb9-001a6c9dad78@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793890679935 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.273 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: LIUNDLNP6SHD77TP2EKS5S52MDCQQCCX X-Message-ID-Hash: LIUNDLNP6SHD77TP2EKS5S52MDCQQCCX X-MailFrom: f.schauer@proxmox.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 CC: pve-devel X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I ended up with a very different approach while making use of `lxc.console.buffer.size`: Superseded-by: https://lore.proxmox.com/pve-devel/20261105144947.124148-1-f.schauer@proxmox.com On 28/09/2026 13:02, Filip Schauer wrote: > The dtach patch alone would therefore grant us the scrollback as soon as > the console has been opened for the first time. > > To retain early boot diagnostics as well, the dtach master needs to be > started when the container starts, rather than when the console is first > opened in the web UI. This is why my patch starts a master process in > src/PVE/LXC.pm:vm_start. > > The drawback is that containers whose consoles are never opened will now > also retain a dtach master process. > I measured the memory overhead of different approaches: > * Native C dtach: ~1.2 MB RSS > * Perl dtach-scrollback-master: ~7 MB RSS > > While 7 MB is lean for Perl, it adds up with each running container. > > Regarding patching dtach directly: very recently a new pull request was > created on GitHub that implements a configurable scrollback buffer along > with some special handling for terminal escape sequences: > https://github.com/crigler/dtach/pull/32 > > The problem is that we don't know when or if the PR will be merged > upstream, and waiting for it to reach Debian could take a long time. > > So I see a few options going forward: > * Vendor dtach with PR #32 applied ourselves > * Use the dtach-scrollback-master Perl implementation and accept the >   memory overhead > * Write our own lightweight dtach master in Rust to avoid having to >   vendor dtach while keeping the memory footprint low > > >