Skip to navigationSkip to content
libvirtd docs
InteractiveCommands

Manual nav

Search `/` · tty `~` · g top · G bottom

Portal

  • Manual index
  • Interactive lab
  • Command explorer
Foundations5 sections
  • libvirtd Overview1
  • Host & Installation2
  • Architecture & Concepts6
  • Domains2
  • Domain XML2
Subsystems6 sections
  • Daemons3
  • virsh3
  • Virtual Networking5
  • Virtual Storage4
  • Virtualization Security3
  • Remote libvirt1
Operations5 sections
  • Migration2
  • Snapshots & Backup2
  • Performance3
  • Troubleshooting2
  • Reference2
mansecurityReviewed August 8, 2026

SELinux, virtd_t, and common denials

On SELinux enabled hosts, libvirt daemons run in controlled domains such as virtd t. Guest resources often carry svirt labels so the hypervisor can touch only what the policy allows. Why this breaks guest startup The gue

selinuxvirtd_tsvirtavc

On SELinux-enabled hosts, libvirt daemons run in controlled domains such as virtd_t. Guest resources often carry svirt_* labels so the hypervisor can touch only what the policy allows.

Why this breaks guest startup

The guest XML may be correct while SELinux blocks the disk path, firmware file, socket, or host device. That means the fix is usually labeling or policy, not a libvirt syntax change.

BASH
getenforce
ps -eZ | grep -E "virtqemud|libvirtd"
ausearch -m AVC,USER_AVC -ts recent

Do not normalize on permissive mode

Use permissive mode only to prove a policy hypothesis during debugging. The durable fix is relabeling, adjusting file placement, or changing the relevant boolean or policy.

Triage order

Use evidence in this order before changing policy:

  1. Check the AVC details and owning context.
  2. Read the exact service and file labels involved in the denial.
  3. Confirm whether the daemon boundary is actually the one implicated by the evidence.
  4. Only then decide whether a policy adjustment is justified.

This order prevents a valid confinement decision from being mistaken for a reason to weaken SELinux. First prove what was denied, then prove which labels and process boundary own the denial, and only then decide whether the desired access should exist.

Common denial patterns

  • Disk images stored in a random directory without the expected label.
  • ISO files mounted from a path that the daemon domain cannot read.
  • Shared folders or custom device nodes that never received the right context.

Fix pattern

BASH
ls -Z /var/lib/libvirt /var/lib/libvirt/images
restorecon -Rv /var/lib/libvirt
journalctl -t setroubleshoot -n 50

If the storage path is intentionally outside the default tree, document the labeling strategy instead of relying on ad hoc fixes.

Related

  • Pool and volume workflows
  • AppArmor and the sVirt isolation model
  • Troubleshooting playbook

On this page

  • Why this breaks guest startup
  • Triage order
  • Common denial patterns
  • Fix pattern