[PR #4906] [MERGED] PVE-Privilege-Converter #5348

Open
opened 2025-11-20 07:05:32 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/4906
Author: @MickLesk
Created: 6/2/2025
Status: Merged
Merged: 6/2/2025
Merged by: @CrazyWolf13

Base: mainHead: priv_converter


📝 Commits (1)

📊 Changes

2 files changed (+244 additions, -0 deletions)

View changed files

frontend/public/json/pve-privilege-converter.json (+48 -0)
tools/pve/pve-privilege-converter.sh (+196 -0)

📄 Description

✍️ 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/4906 **Author:** [@MickLesk](https://github.com/MickLesk) **Created:** 6/2/2025 **Status:** ✅ Merged **Merged:** 6/2/2025 **Merged by:** [@CrazyWolf13](https://github.com/CrazyWolf13) **Base:** `main` ← **Head:** `priv_converter` --- ### 📝 Commits (1) - [`f7580bc`](https://github.com/community-scripts/ProxmoxVE/commit/f7580bc596ad2ae5092c92e472cd222101216965) PVE-Privilege-Converter ### 📊 Changes **2 files changed** (+244 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `frontend/public/json/pve-privilege-converter.json` (+48 -0) ➕ `tools/pve/pve-privilege-converter.sh` (+196 -0) </details> ### 📄 Description ## ✍️ 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 07:05:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#5348