Linux command
virsh-list 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List running domains
virsh list
List all domains
virsh list --all
List all with title column
virsh list --all --title
List only shut off domains
virsh list --state-shutoff
List domains with autostart info
virsh list --all --autostart
List only domain names
virsh list --all --name
List inactive domains only
virsh list --inactive
说明
virsh list displays virtual machines managed by libvirt. Shows domain ID, name, and state. By default only shows running VMs; use `--all` for a complete list including inactive domains. The domain ID is only assigned to running domains.
参数
- --all
- Include inactive domains.
- --inactive
- List only inactive (shut off) domains.
- --state-running
- List only running domains.
- --state-paused
- List only paused domains.
- --state-shutoff
- List only shut off domains.
- --state-other
- List only domains in other states (crashed, dying, pmsuspended).
- --transient
- List only transient domains (not persistently defined).
- --title
- Show domain titles column.
- --autostart
- Show autostart status column.
- --no-autostart
- List only domains not configured for autostart.
- --name
- Show only domain names (one per line).
- --uuid
- Show only domain UUIDs.
- --id
- Show only domain IDs.
- --managed-save
- Show managed save state.
- --with-managed-save
- List only domains with managed save state.
- --without-managed-save
- List only domains without managed save state.
FAQ
What is the virsh-list command used for?
virsh list displays virtual machines managed by libvirt. Shows domain ID, name, and state. By default only shows running VMs; use `--all` for a complete list including inactive domains. The domain ID is only assigned to running domains.
How do I run a basic virsh-list example?
Run `virsh list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --all do in virsh-list?
Include inactive domains.