List all libvirt domains, including inactive ones.
Which command is appropriate?
virsh list --all includes both running and inactive domains.
Detailed explanation
virsh listIncorrect. Plain virsh list normally shows active domains only.
Incorrect. Plain virsh list normally shows active domains only.
virsh dominfo --runningIncorrect. dominfo inspects one domain rather than listing all states.
Incorrect. dominfo inspects one domain rather than listing all states.
virsh list --allCorrect. virsh list --all includes inactive domains.
Correct. virsh list --all includes inactive domains.
virsh net-list --allIncorrect. net-list lists virtual networks, not domains.
Incorrect. net-list lists virtual networks, not domains.
Try it yourself
An example you can run in a temporary verification environment.
virsh help list 2>/dev/null | grep -E -- '--all|-a' || trueExpected result
virshがある場合は--allのhelpKey points
- virsh list --all
- Inactive domain
- Domain state
Notes
- Environment: virsh helpのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.