[pve-devel] [PATCH container v5 05/17] config: add `lxc.environment.runtime`/`hooks`

Filip Schauer f.schauer at proxmox.com
Wed Oct 8 19:10:11 CEST 2025


Add `lxc.environment.runtime` and `lxc.environment.hooks` config keys.
These allow setting environment variables separately for the container
init process and for LXC hooks.

This will be needed by containers created from OCI images with custom
environment variables which could interfere with hook execution.

Signed-off-by: Filip Schauer <f.schauer at proxmox.com>
---
This patch depends on the upstream lxc commit df8cf80e960e, which is
expected to be included in the next lxc release 6.0.6.

Introduced in v4

 src/PVE/LXC/Config.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 5d3749e..1038fa7 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -736,6 +736,8 @@ my $valid_lxc_conf_keys = {
     'lxc.start.order' => 1,
     'lxc.group' => 1,
     'lxc.environment' => 1,
+    'lxc.environment.runtime' => 1,
+    'lxc.environment.hooks' => 1,
 
     # All these are namespaced via CLONE_NEWIPC (see namespaces(7)).
     'lxc.sysctl.fs.mqueue' => 1,
-- 
2.47.3





More information about the pve-devel mailing list