From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: console: detect and warn on application containers
Date: Tue, 18 Nov 2025 14:07:04 +0100 [thread overview]
Message-ID: <20251118130710.2362914-1-d.csapak@proxmox.com> (raw)
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 <d.csapak@proxmox.com>
---
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
next reply other threads:[~2025-11-18 13:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 13:07 Dominik Csapak [this message]
2025-11-18 14:14 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251118130710.2362914-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox