From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 126E31FF187 for ; Tue, 18 Nov 2025 14:07:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CBF5C14744; Tue, 18 Nov 2025 14:07:43 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Tue, 18 Nov 2025 14:07:04 +0100 Message-ID: <20251118130710.2362914-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager] ui: console: detect and warn on application containers X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" application containers often don't have a functional shell (since it runs directly, without init) so try to detect and warn the users in the inline console. The detection heuristic is: * cmode is 'console' * entrypiont is not '/sbin/init' Those values are not the (lxc) default and should cover most application containers. Since we change the layout a bit, focus the actual iframe component, not the panel. Signed-off-by: Dominik Csapak --- www/manager6/VNCConsole.js | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/www/manager6/VNCConsole.js b/www/manager6/VNCConsole.js index e4f22cf9..399ed55f 100644 --- a/www/manager6/VNCConsole.js +++ b/www/manager6/VNCConsole.js @@ -29,11 +29,25 @@ Ext.define('PVE.noVncConsole', { // always use same iframe, to avoid running several noVnc clients // at same time (to avoid performance problems) - var box = Ext.create('Ext.ux.IFrame', { itemid: 'vncconsole' }); + var box = Ext.create('Ext.ux.IFrame', { itemid: 'vncconsole', flex: 1 }); + + let warning = Ext.create('Ext.Component', { + userCls: 'pmx-hint', + padding: 5, + hidden: true, + style: { + 'text-align': 'center', + }, + html: gettext('Application Container detected - console might not be functional.'), + }); var type = me.xtermjs ? 'xtermjs' : 'novnc'; Ext.apply(me, { - items: box, + layout: { + type: 'vbox', + align: 'stretch', + }, + items: [warning, box], listeners: { activate: function () { let sp = Ext.state.Manager.getProvider(); @@ -58,8 +72,24 @@ Ext.define('PVE.noVncConsole', { me.callParent(); + // check for app container + if (me.consoleType === 'lxc') { + Proxmox.Utils.API2Request({ + url: `/nodes/${me.nodename}/lxc/${me.vmid}/config`, + success: function (response) { + let consoleMode = response?.result?.data?.cmode; + let entryPoint = response?.result?.data?.entrypoint; + let customEntryPoint = entryPoint !== undefined && entryPoint !== '/sbin/init'; + + if (customEntryPoint && consoleMode === 'console') { + warning.setVisible(true); + } + }, + }); + } + me.on('afterrender', function () { - me.focus(); + box.focus(); }); }, -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel