virt-install vTPM issue
from stoicmaverick@lemmy.world to linux@lemmy.ml on 21 Jul 2024 03:02
https://lemmy.world/post/17792048

Sorry to be a bother, but I’m hitting a wall here, and my google-fu is not strong enough apparently. I’m trying to reinstall a Home Assistant VM on my server, (It’s been a while, and I have no idea how I did it originally). Running: virt-install --name haos --description “Home Assistant OS” --os-variant=generic --ram=16384 --vcpus=4 --disk /home/chris/haos_ova-12.4.qcow2,bus=scsi --controller type=scsi,model=virtio-scsi --import --graphics none --boot uefi

Returns:

`WARNING KVM acceleration not available, using ‘qemu’ WARNING Using --osinfo generic, VM performance may suffer. Specify an accurate OS for optimal results.

Starting install… ERROR internal error: Could not run ‘/usr/bin/swtpm_setup’. exitstatus: 1; Check error log ‘/home/chris/.cache/libvirt/qemu/log/haos-swtpm.log’ for details. Domain installation does not appear to have been successful. If it was, you can restart your domain by running: virsh --connect qemu:///session start haos otherwise, please restart your installation.`

Checking the ‘haos-swtpm.log’ shows repeated entries of:

Starting vTPM manufacturing as chris:chris @ Sun 21 Jul 2024 02:58:07 AM UTC Successfully created RSA 2048 EK with handle 0x81010001. Invoking /usr/lib/x86_64-linux-gnu/swtpm/swtpm-localca --type ek --ek af44f41c741b89d0a45748c4bb34d21457da950586715133274c649c7a84dd7dffcbd1b53f2f56f7b24a00529e92db82e30b60a759672531a3c5faea54a71fb8df433f9034bfad37d7561fd187c9562024322d6a7ab41e1af26b0cbe67a66869b9f779eef408f27e14f97d365be47921612e8d9ca010dfdd9ab08c3a321b795b3b2809f1bd132b57eb6408569c38f7558eda65e1787c4d4b077794b249c87fa5f275cf8bc8bbce41467448b4ee9648da06a84a0c03378416f1a5dec7c5317e5f0883ca515e207fce70495f144148d18ac34def0e2415d3e82fcfe9224848b7ccfe35143207b0f1fce4293cd9cd1c11daa3d45463b0c17ad7d988438c52aa631f --dir /home/chris/.config/libvirt/qemu/swtpm/d7406119-26ab-4e42-b98e-46065e1ea2eb/tpm2 --logfile /home/chris/.cache/libvirt/qemu/log/haos-swtpm.log --vmid haos:d7406119-26ab-4e42-b98e-46065e1ea2eb --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 Need read/write rights on statedir /var/lib/swtpm-localca for user chris. swtpm-localca exit with status 1: An error occurred. Authoring the TPM state failed. Ending vTPM manufacturing @ Sun 21 Jul 2024 02:58:07 AM UTC

I gather that it seems to be a issue with the vTPM, but I usually deal in containers, so this is all new on me.

Thanks in advance.

#linux

threaded - newest

just_another_person@lemmy.world on 21 Jul 2024 03:31 next collapse

Check your BIOS and make sure hardware virtualization is actually enabled.

stoicmaverick@lemmy.world on 21 Jul 2024 03:59 collapse

It should be. I just had an identical VM running on the same machine yesterday. Oddly, it stopped being able to boot for unclear reasons, so I’m trying a fresh install.

just_another_person@lemmy.world on 21 Jul 2024 04:00 collapse

Check your BIOS. I’m positive this is the issue.

stoicmaverick@lemmy.world on 21 Jul 2024 19:12 collapse

I checked. It’s still enabled.

just_another_person@lemmy.world on 21 Jul 2024 19:17 collapse

What motherboard are you running?

Also, are you sure your user has the right permissions to access libvirt assets? Do you get the same error if you run as sudo?

SteveTech@programming.dev on 21 Jul 2024 08:03 next collapse

WARNING KVM acceleration not available, using ‘qemu’

That’s related to hardware virtualisation, like the other person said, check that it’s enabled.

WARNING Using --osinfo generic, VM performance may suffer. Specify an accurate OS for optimal results.

This is related to –os-variant=generic, I don’t remember what Home Assistant OS is based off, but find out and pick an option from virt-install --os-variant list, otherwise use linux2022.

ERROR internal error: Could not run ‘/usr/bin/swtpm_setup’.

I’m not sure why it’s attaching a TPM, but I believe –tpm clearxml=true should remove it.

isgleas@lemmy.ml on 21 Jul 2024 11:42 next collapse

What are you reinstalling? New haos on old kvm? Old haos on new kvm? New deployment?

From the logs I read that your user chris has no rw perms within the haos.

[deleted] on 21 Jul 2024 13:07 collapse

.