pct restore --password option does not set root password (works with pct create)

nethub

New Member
Sep 12, 2024
7
2
3
Hi all,

When restoring a container from a vzdump backup using pct restore, the --password option does not set the root password in the restored container.

The same --password option works correctly when used with pct create.

Is this a known limitation or a bug?

Proxmox VE version: 9.1.1
Container: unprivileged , AlmaLinux 9, Ubuntu 24

Steps to reproduce​

  1. backup a container:
    Bash:
    vzdump 101 --mode stop --compress zstd --dumpdir /var/lib/vz/dump/

  2. Restore the backup to a new CT and assign a root password:
    Bash:
    pct restore 102 /var/lib/vz/dump/vzdump-lxc-101-2025_12_18-14_56_55.tar.zst \
      --password $PASSWORD \
      --unprivileged 1 \
      --rootfs local-lvm:10

  3. Start the restored container:
    Bash:
    pct start 102

  4. Attempt to log in as root



Expected behavior​


The root password of CT 102 should be set to the value provided via --password



Actual behavior​

  • Root password remains unchanged from the backup
  • The password provided via --password is ignored
  • No warning or error is shown during restore
 
yes. restore and create share a common API endpoint, and in this case, --password is currently only handled for create. it should either error out or be supported when set via restore.