bluefin: Libvirt can't create new VM (logging issue)

Describe the bug

I would like to set up rather permanent Windows 11 VM, so I am trying to use libvirt along with its VM Manager.

Here’s the error: Unable to complete install: ‘can’t connect to virtlogd: Unable to open file: /var/log/libvirt/qemu/XPS.log: Permission denied’

Traceback (most recent call last): File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File “/usr/share/virt-manager/virtManager/createvm.py”, line 2008, in _do_async_install installer.start_install(guest, meter=meter) File “/usr/share/virt-manager/virtinst/install/installer.py”, line 695, in start_install domain = self._create_guest( ^^^^^^^^^^^^^^^^^^^ File “/usr/share/virt-manager/virtinst/install/installer.py”, line 637, in _create_guest domain = self.conn.createXML(initial_xml or final_xml, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/lib64/python3.12/site-packages/libvirt.py”, line 4529, in createXML raise libvirtError(‘virDomainCreateXML() failed’) libvirt.libvirtError: can’t connect to virtlogd: Unable to open file: /var/log/libvirt/qemu/XPS.log: Permission denied

I tried to change the dir to 777, I even tried to touch the file, but it didn’t help: ❯ ls -ltra /var/log/libvirt/qemu/ total 0 drwxrwxrwx. 1 root root 8 May 7 14:29 … -rw-r–r–. 1 slavek slavek 0 May 7 14:32 XPS.log drwxrwxrwx. 1 root root 18 May 7 14:32 .

I tried to go with manual setup as well as semi-automated ISO setup, both cases gave the same error.

What did you expect to happen?

I expect libvirt to start making my VM!

Output of rpm-ostree status

State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 1 day 1h ago
Deployments:
  ostree-image-signed:docker://ghcr.io/ublue-os/aurora-dx:latest
                   Digest: sha256:5d64652fe35ea16c895962b31b4c41cfaeab904c392d99cce67cd3e99640ce83
                  Version: 40.20240506.0 (2024-05-06T16:53:28Z)
                     Diff: 12 upgraded

● ostree-image-signed:docker://ghcr.io/ublue-os/aurora-dx:latest
                   Digest: sha256:8f5d5c70a409c581c25fc3d7bcc0be565a4bcc237030022fa63050244b7bfad2
                  Version: 40.20240505.0 (2024-05-05T16:51:55Z)

  ostree-image-signed:docker://ghcr.io/ublue-os/aurora-dx:latest
                   Digest: sha256:e9d1f50e54f031f14c9edc34ecbff4e1762e46670694618b055af60830409c4d
                  Version: 40.20240428.0 (2024-04-29T02:07:21Z)

Extra information or context

I have disabled root account for the installation, if that makes any difference.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 36 (19 by maintainers)

Most upvoted comments

I’m also having this issue now on bluefin-dx-nvidia:latest

@castrojo I think this may be fixed. I added a systems unit to run restorecon on the directory and a tmpfiles.d entry to create the directory

If you guys dont need stuff like privileged networking or PCIe passthrough a good alternative might be the virt-manager QEMU extension

Can we reopen this case, the issue is back again and there no fixes. Current: Bazzite 41 - Deckgnome. Also i needs to run Windows 11 in vm from my bare-metal linux so if someone can explain it’s could help.

For the time being do a restorecon like you did.

This is some sort of packaging difference between F39 and F40. For whatever reason the files are created with no SELinux labels and they don’t get restoreconed on first boot. Since they are in a mutable location it’s not a hard fix.

The bigger issue is for things that have the wrong label in /usr.

You don’t have the MOK installed for secureboot.

Unsigned Out of tree modules will be rejected when secureboot is enabled.

I tried at least to go without turning off SElinux… but so far:

sudo chmod 700 /var/log/libvirt/qemu

sudo restorecon -rv /var/log/libvirt/

Relabeled /var/log/libvirt from system_u:object_r:var_log_t:s0 to system_u:object_r:virt_log_t:s0 Relabeled /var/log/libvirt/qemu from system_u:object_r:var_log_t:s0 to system_u:object_r:virt_log_t:s0

sudo restorecon -rv /var/lib/libvirt/

Relabeled /var/lib/libvirt from system_u:object_r:var_lib_t:s0 to system_u:object_r:virt_var_lib_t:s0 Relabeled /var/lib/libvirt/qemu from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/save from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/snapshot from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/checkpoint from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/dump from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/nvram from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/nvram/win11_VARS.qcow2 from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/qemu/ram from system_u:object_r:var_lib_t:s0 to system_u:object_r:qemu_var_run_t:s0 Relabeled /var/lib/libvirt/images from system_u:object_r:var_lib_t:s0 to system_u:object_r:virt_image_t:s0 Relabeled /var/lib/libvirt/images/win11.qcow2 from system_u:object_r:var_lib_t:s0 to system_u:object_r:virt_image_t:s0

sudo virsh net-start default

Network default started

So here at least the network is catching up and all relevant dirs seem to have proper rights (comparing to F39).

However installation is giving me now:

libvirt.libvirtError: internal error: Could not run ‘/usr/bin/swtpm_setup’. exitstatus: 1; Check error log ‘/var/log/swtpm/libvirt/qemu/win11-swtpm.log’ for details.

❯ sudo cat /var/log/swtpm/libvirt/qemu/win11-swtpm.log
swtpm at /usr/bin/swtpm does not support TPM 2
swtpm at /usr/bin/swtpm does not support TPM 1.2

According to F40 forum from 8 days ago:

swtpm 0.8.1-9 solves all issues we have documented

Not sure how can I check my version:

❯ /usr/bin/swtpm --version
TPM emulator version 0.8.1, Copyright (c) 2014-2022 IBM Corp. and others

Yes, indeed. All seems to be working well. I have installed my Aurora 3 days ago - a day after 2.6.0 was released (I have Framework 16, so I was waiting for some FW-related goodies, to make sure all works well).

We pull from upstream each day.

I’m curious why permissive mode failed, it should of just logged the violation instead of failing.

restorecon should be the fix in this situation if the file tree at that location has the wrong labels or in this case missing labels.

After a restorecon I’m assuming it’s now working. Since it’s applied to /var it will persist through reboots.

For timeline of the bug, did you do a fresh install of f40? Roughly when?