To set up TPM-based automatic LUKS unlocking for a Fedora VM on Proxmox VE, follow these steps:
- Shut down the VM.
- Go to Hardware > Add > TPM State.
- Select a storage location and ensure version is v2.0.
- Note: The VM must be using UEFI (OVMF).
Boot the VM and run the following commands as root:
- Install TPM package, if required:
sudo dnf install tpm2-tss- Bind LUKS to TPM:
Identify your encrypted partition (usually
/dev/sda3or similar) usinglsblk, then run:
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+4+7 /dev/sdXN(Replace /dev/sdXN with your actual partition; enter your current passphrase when prompted.)
- Edit Crypttab:
Open /etc/crypttab and append tpm2-device=auto to your root disk options:
luks-uuid... UUID=... none tpm2-device=auto
- Rebuild Boot Image:
sudo dracut -f- Reboot the VM.
- The system should now bypass the manual passphrase prompt and proceed directly to the login screen.