[pve-devel] [PATCH container 1/3] api: create: default to unprivileged containers

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jul 30 17:00:10 CEST 2025


restore keeps what is in the backup config, but allows switching to
unprivileged. switching from unprivileged to privileged requires VM.Allocate at
the moment.

the config schema default cannot easily be changed to unprivileged, as that
would break existing configs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/PVE/API2/LXC.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index a56c441..a247b80 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -252,6 +252,8 @@ __PACKAGE__->register_method({
 
         if ($restore) {
             # fixme: limit allowed parameters
+        } else {
+            $unprivileged = 1 if !defined($unprivileged);
         }
 
         my $force = extract_param($param, 'force');
-- 
2.39.5





More information about the pve-devel mailing list