KVM : Enable TPM 2.02026/04/29 |
|
Create a Virtual Machine with enabling TPM 2.0. |
|
| [1] | Install required packages. |
|
root@dlp:~# apt -y install ovmf swtpm swtpm-tools
|
| [2] | As an example, we will create a Windows 11 virtual machine. If you specify Windows 11 for [os-variant], TPM 2.0 and Secure Boot will be automatically enabled. However, to explicitly enable them on Windows Server or Linux, specify them as follows. |
root@dlp:~# virt-install \
--name Windows_11 \
--ram 6144 \
--disk path=/var/kvm/images/Windows_11.img,size=40 \
--cpu host-passthrough \
--vcpus=4 \
--os-variant=win11 \
--network bridge=br0 \
--graphics vnc,listen=0.0.0.0,password=password \
--video virtio \
--cdrom /home/Win11_24H2_English_x64.iso \
--features kvm_hidden=on,smm=on \
--tpm backend.type=emulator,backend.version=2.0,model=tpm-tis \
--boot loader=/usr/share/OVMF/OVMF_CODE_4M.secboot.fd,loader_ro=yes,loader_type=pflash,nvram_template=/usr/share/OVMF/OVMF_VARS_4M.fd
|
| [3] | Windows 11 installer starts. |
|
| [4] | Installation finished and Windows 11 is running. |
|
|
| Sponsored Link |
|
|