# 使用 Homebrew, apk, dnf, MacPorts, Nix, pacman, zypper, apt 安装 libvirt

查看 libvirt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:libvirt
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libvirt
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libvirt
```

  证据: MacPorts ports tree: sysutils/libvirt/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add libvirt
```

  证据: Alpine Linux edge package indexes: libvirt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install libvirt
```

  证据: Fedora Rawhide package metadata: libvirt from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#libvirt
```

  证据: nixpkgs package indexes: pkgs/by-name/li/libvirt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S libvirt
```

  证据: Arch Linux sync databases: libvirt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install libvirt
```

  证据: openSUSE Tumbleweed package metadata: libvirt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

- Debian apt (92%):

```sh
sudo apt install libnss-libvirt
```

  证据: Debian stable package indexes: libnss-libvirt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:libvirt
- **软件包管理器:** Homebrew
- **版本:** 12.5.0
- **来源摘要:** C virtualization API
- **主页:** <https://libvirt.org/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- libvirtd (别名)
- virsh (别名)
- virt-admin (别名)
- virt-host-validate (别名)
- virt-login-shell (别名)
- virt-pki-query-dn (别名)
- virt-pki-validate (别名)
- virt-qemu-qmp-proxy (别名)
- virt-qemu-run (别名)
- virt-qemu-sev-validate (别名)
- virt-ssh-helper (别名)
- virt-xml-validate (别名)
- virtchd (别名)
- virtlockd (别名)
- virtlogd (别名)
- virtlxcd (别名)
- virtnetworkd (别名)
- virtnwfilterd (别名)
- virtproxyd (别名)
- virtqemud (别名)
- virtsecretd (别名)
- virtstoraged (别名)
- virtvboxd (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 12.5.0
## 项目历史与用法

libvirt is the long-lived virtualization management API and daemon stack that gives tools a common way to manage domains, networks, storage, and host resources across hypervisors.

### 项目历史

The project was created to provide a common and stable layer for managing virtualized domains on local or remote nodes. Its own goals page emphasizes API stability, secure remote management, resource enumeration, and the ability to insulate applications from frequent changes in lower-level virtualization frameworks.

libvirt became especially important as Linux virtualization consolidated around QEMU and KVM while still needing to interoperate with Xen, LXC, bhyve, VMware, VirtualBox, Hyper-V, and other backends. The project website describes a portable C API, stateful host daemons for some hypervisors, and language bindings layered on top of the core API.

### 采用历史

The adoption story is unusually broad for a system library. The official applications page lists command-line tools, desktop applications, provisioning tools, monitoring systems, web applications, configuration-management integrations, backup tools, and infrastructure-as-a-service stacks using the libvirt API.

For package managers, libvirt is not just a library dependency; it is an ecosystem root. Installing it can bring daemons such as libvirtd or modular virt* daemons, virsh, validation tools, NSS integration packages, storage and network drivers, language bindings, and downstream tools such as virt-manager, virt-install, Vagrant providers, and cloud or CI integrations.

### 使用方式

Administrators commonly use virsh and libvirt daemons to define, start, stop, migrate, inspect, and automate virtual machines and container-like domains. Application developers use the API and bindings to build higher-level management tools while avoiding direct hypervisor-specific control protocols.

On developer workstations it is often the package behind local KVM/QEMU workflows; on servers it is the control plane layer used by provisioning, monitoring, and orchestration software that needs stable VM lifecycle operations.

### 为什么软件包爱好者会关心

libvirt is package-nerd famous because it sits at the junction of init systems, daemon socket activation, TLS and PKI material, kernel capabilities, QEMU/KVM feature flags, storage pools, virtual networking, and language bindings. It is the sort of dependency whose packaging details define whether virtualization feels boring or impossible.

It also illustrates why stable C APIs matter in infrastructure: a large ecosystem of frontends can keep working while hypervisors, host operating systems, and security models change underneath.

### 时间线

- 2005: Early libvirt releases began the public release history recorded by the project news archive.
- 2012: The 1.0 series marked libvirt as a mature cross-hypervisor management layer.
- 2021-01-15: libvirt 7.0.0 release notes recorded a formal handover of release tarball signing.
- 2026-07-01: The project website listed support for QEMU/KVM, Xen, LXC, bhyve, VMware, Hyper-V, VirtualBox, macOS Hypervisor.framework, and other drivers.

### Related projects

- QEMU and KVM are among the most common backends managed through libvirt.
- Xen, LXC, bhyve, VMware ESX/vCenter, Hyper-V, VirtualBox, Virtuozzo, and POWER Hypervisor are supported or related virtualization targets.
- virt-manager, virt-install, guestfish, vagrant-libvirt, and many monitoring and provisioning tools sit above the libvirt API.

### 来源

- <https://gitlab.com/libvirt/libvirt>
- <https://libvirt.org/>
- <https://libvirt.org/apps.html>
- <https://libvirt.org/downloads.html>
- <https://libvirt.org/goals.html>
- <https://libvirt.org/news.html>


## 安全说明

broad file, network, media, or database tool signal. formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- broad file, network, media, or database tool signal
- formula declares a Homebrew service
- generalized runtime or code generation signal
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: /etc/libvirt/libvirtd.conf, /etc/libvirt/libvirt.conf, $XDG_CONFIG_HOME/libvirt/libvirt.conf

## Credential files

- Unix: /etc/pki/CA/cacert.pem, /etc/pki/libvirt/servercert.pem, /etc/pki/libvirt/private/serverkey.pem
## 其他软件包管理器记录

- Debian apt - libnss-libvirt - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libnss-libvirt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization library - NSS plugins | https://libvirt.org/nss.html
- Debian apt - libvirt-clients - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-clients from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization library - clients | https://libvirt.org/
- Debian apt - libvirt-clients-qemu - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-clients-qemu from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization library - clients (QEMU specific) | https://libvirt.org/
- Debian apt - libvirt-common - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization library - common files | https://libvirt.org/
- Debian apt - libvirt-daemon - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon | https://libvirt.org/daemons.html#monolithic-driver-daemon
- Debian apt - libvirt-daemon-common - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - common files | https://libvirt.org/
- Debian apt - libvirt-daemon-config-network - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-config-network from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - configuration files (default network) | https://libvirt.org/
- Debian apt - libvirt-daemon-config-nwfilter - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-config-nwfilter from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - configuration files (default network filters) | https://libvirt.org/
- Debian apt - libvirt-daemon-driver-interface - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-interface from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - interface driver | https://libvirt.org/
- Debian apt - libvirt-daemon-driver-lxc - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-lxc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - LXC connection driver | https://libvirt.org/drvlxc.html
- Debian apt - libvirt-daemon-driver-network - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-network from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - network driver | https://libvirt.org/formatnetwork.html
- Debian apt - libvirt-daemon-driver-nodedev - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-nodedev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - node device (nodedev) driver | https://libvirt.org/drvnodedev.html
- Debian apt - libvirt-daemon-driver-nwfilter - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-nwfilter from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - network filter (nwfilter) driver | https://libvirt.org/formatnwfilter.html
- Debian apt - libvirt-daemon-driver-qemu - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-qemu from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - QEMU connection driver | https://libvirt.org/drvqemu.html
- Debian apt - libvirt-daemon-driver-secret - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-secret from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - secret driver | https://libvirt.org/drvsecret.html
- Debian apt - libvirt-daemon-driver-storage - 11.3.0-3+deb13u2: normalized package name match | Debian stable package indexes: libvirt-daemon-driver-storage from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | virtualization daemon - storage driver | https://libvirt.org/storage.html


## Combined YAML source

View the package source record on GitHub. [combined/libvirt.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libvirt.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
