-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Ubuntu 22.04, SWTPM_NVRAM_Lock_Lockfile: Could not open lockfile: Permission denied #763
Comments
Does the directory |
Yes, that directory exists and contains this file: -rw-rw-r-- 1 xxx xxxx 0 oct 8 09:09 TMP2-00.permall, although the file is not recreated if I deleted it and re-run swtpm |
I think you should describe every step that you do to start swtpm , like starting with the creation of the so-far-non-existing directory for the TPM state and so on so that someone else can just copy and past the commands into a terminal and recreate the issue. |
These are the steps that I followed before the error occurred: Output from swtpm No files were created in the tpmstate dir. syslog contains ... Dev-Workstation kernel: [ 1929.671401] audit: type=1400 audit(1665412130.135:170): apparmor="DENIED" operation="mknod" profile="swtpm" name="/home/andy/tpmstatedir/.lock" pid=6156 comm="swtpm" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000 |
@lvoytek Is this due to the update AppArmor profile? |
I tried disabling apparmor but I still have the same problem. I also tried building from source. That gives me version 0.8.0 of swtpm, but I have the same issue |
If I run it under gdb, then it works. |
After |
Alright, I'll look into it |
Figured out the issue. The profile here works properly, but Ubuntu 22.04 still hasn't included some of the changes made in the process of getting the apparmor profile added upstream, specifically: owner @{HOME}/** rwk, I'll work on getting this fixed asap, downstream bug here: |
In the meantime @ncalad you can add the line to
to get the fix now |
Yes, adding that line to /etc/apparmor.d/local/usr.bin.swtpm which was an empty file, and restarting apparmor fixed the problem for me. Thank you. |
Closing this issue now since it's a distro/package issue. |
For any GNS3 users that come across this error:
|
I installed swtpm using apt-get install swtpm.
swtpm runs but dies with these errors when qemu connects:
swtpm socket --tpm2 --ctrl type=unixio,path=/tmp/swtpm-sock --tpmstate dir=./tmpstatedir
swtpm: SWTPM_NVRAM_Lock_Lockfile: Could not open lockfile: No such file or directory
swtpm: Error: Could not initialize libtpms.
swtpm: Error: Could not initialize the TPM
swtpm: Data client disconnected
The text was updated successfully, but these errors were encountered: