When trying to make a windows 11 VM trough virtual machine manager / QEMU, I get the following error code:
Unable to complete install: 'internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/win11-swtpm.log' for details.'
With this being the log file mentioned above:
Starting vTPM manufacturing as tss:tss @ Fri 03 Jan 2025 03:39:20 PM CET
Successfully created RSA 2048 EK with handle 0x81010001.
Invoking /usr/bin/swtpm_localca --type ek --ek 86f1d945ed740acd02ca222b0f3a47748b709da03195f21096792afdc0edee8ae6a6b3ffb3100892539e1891d516a9dd80baf24e7d89786459f2c4c00c222512fbecca4eafae7f6ad09197ddae6d993b9f43816f24b6d46e40e33aea23648e99fab1da7dfb1ff1bedf2b7e59dc4c210fc5f64f1cea91a4b5b2783451b9aa3b03491b981e4efe00a55e1791da58c7565c361011c741387578f601d7664975a1fd29760c316064a259d023c3eb6646884bb992b4368ceead88da8069d5463c40dfaab956a55ecede58ac1c047ee3834c59a4a4974d4f533f687f0dc6b1001ec30e334f355813ec8196410f100d367e4f57e67b9aa17af6c1dab1301104c95d0911 --dir /tmp/swtpm_setup.certs.5WGZZ2 --logfile /var/log/swtpm/libvirt/qemu/win11-swtpm.log --vmid win11:d0f30341-728f-4213-9548-426ebeea4be9 --tpm-spec-family 2.0 --tpm-spec-level 0 --tpm-spec-revision 164 --tpm-manufacturer id:00001014 --tpm-model swtpm --tpm-version id:20191023 --tpm2 --configfile /etc/swtpm-localca.conf --optsfile /etc/swtpm-localca.options
Creating swtpm-localca dir '/var/lib/swtpm-localca'.
Could not create directory for 'statedir': Permission denied
swtpm_localca exit with status 1:
An error occurred. Authoring the TPM state failed.
Error getting next filename: No child processes
Ending vTPM manufacturing @ Fri 03 Jan 2025 03:39:20 PM CET
As it says its missing permissions but i dont know what SWTPM needs for permissions and what the correct way is to handle this issue.