List only the currently running libvirt domains.
Which command is appropriate?
virsh list displays currently running libvirt domains by default.
Detailed explanation
virsh start --listIncorrect. start is an action and does not list running domains in this form.
Incorrect. start is an action and does not list running domains in this form.
virsh listCorrect. virsh list shows active domains.
Correct. virsh list shows active domains.
virsh console --allIncorrect. console connects to a guest and does not list domains.
Incorrect. console connects to a guest and does not list domains.
virsh destroy --dry-runIncorrect. destroy forcibly stops a domain and is not a dry-run listing command.
Incorrect. destroy forcibly stops a domain and is not a dry-run listing command.
Try it yourself
An example you can run in a temporary verification environment.
virsh help list 2>/dev/null | head -n 8 || trueExpected result
virshがある場合はlistのhelp。libvirtへ接続しないKey points
- virsh list
- Running domain
- libvirt
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.