[PR #4906] PVE-Privilege-Converter #5351

Closed
opened 2025-11-20 07:05:33 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/community-scripts/ProxmoxVE/pull/4906

State: closed
Merged: Yes


✍️ Description

-- wait for core.func merge --

This script provides a safe and automated way to convert Proxmox LXC containers between unprivileged and privileged modes using a backup/restore workflow.

Features

  • Interactive selection of the source container
  • Automatic backup via vzdump to a selected backup storage
  • Interactive selection of target storage for the restored container
  • Auto-suggestion of the next available container ID
  • Supports converting:
    • 🔒 Unprivileged → Privileged
    • 🔓 Privileged → Unprivileged
  • Preserves container configuration and restores from .tar.zst archive
  • Optional shutdown of the source container and start of the new one
  • Optional deletion of the temporary backup archive
  • Fully styled msg_custom output with clear and structured summary

💡 Example Workflow

  1. Select source container
  2. Choose backup storage
  3. Backup is created using vzdump
  4. Choose target storage and set new container ID
  5. Container is restored in the desired privilege mode
  6. Source can be shut down, and new container started
  7. Optional cleanup of the archive

📦 Output Example

📄 Summary:
   Original Container:     106 (debian)
   Backup Storage:         local
   Target Storage:         local-lvm
   Backup Path:            /var/lib/vz/dump/vzdump-lxc-106-2025_06_02-09_58_41.tar.zst
   New Container ID:       109
   Privilege Conversion:   Unprivileged → Privileged

image

Prerequisites (X in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

🛠️ Type of Change (X in brackets)

  • 🆕 New script – A fully functional and tested script or script set.
**Original Pull Request:** https://github.com/community-scripts/ProxmoxVE/pull/4906 **State:** closed **Merged:** Yes --- ## ✍️ Description -- wait for core.func merge -- This script provides a safe and automated way to **convert Proxmox LXC containers** between **unprivileged** and **privileged** modes using a backup/restore workflow. ### ✅ Features - Interactive selection of the source container - Automatic backup via `vzdump` to a selected backup storage - Interactive selection of target storage for the restored container - Auto-suggestion of the next available container ID - Supports converting: - 🔒 Unprivileged → Privileged - 🔓 Privileged → Unprivileged - Preserves container configuration and restores from `.tar.zst` archive - Optional shutdown of the source container and start of the new one - Optional deletion of the temporary backup archive - Fully styled `msg_custom` output with clear and structured summary ### 💡 Example Workflow 1. Select source container 2. Choose backup storage 3. Backup is created using `vzdump` 4. Choose target storage and set new container ID 5. Container is restored in the desired privilege mode 6. Source can be shut down, and new container started 7. Optional cleanup of the archive ### 📦 Output Example ```text 📄 Summary: Original Container: 106 (debian) Backup Storage: local Target Storage: local-lvm Backup Path: /var/lib/vz/dump/vzdump-lxc-106-2025_06_02-09_58_41.tar.zst New Container ID: 109 Privilege Conversion: Unprivileged → Privileged ``` ![image](https://github.com/user-attachments/assets/5c71bea3-50f5-41bb-959a-89cfb5a17a0d) ## ✅ Prerequisites (**X** in brackets) - [x] **Self-review completed** – Code follows project standards. - [x] **Tested thoroughly** – Changes work as expected. - [x] **No security risks** – No hardcoded secrets, unnecessary privilege escalations, or permission issues. --- ## 🛠️ Type of Change (**X** in brackets) - [x] 🆕 **New script** – A fully functional and tested script or script set.
saavagebueno added the pull-request label 2025-11-20 07:05:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5351