virsh list
returns an empty list but the gui virt-manager
has 2 defined QEMU/KVM virtual machines. How come virsh list
doesn't list anythng ?
Asked
Active
Viewed 4.8k times
20

ChiseledAbs
- 2,243
1 Answers
21
The virsh list
command only runs things running.
If you want things defined but not running then
virsh list --all
And remember each type of namespace is distinct so you may need --connect
as well
e.g.
$ virsh -c lxc:/// list
Id Name State
----------------------------------------------------
$ virsh -c lxc:/// list --all
Id Name State
----------------------------------------------------
- helloworld shut off
$ virsh -c qemu:///system list
Id Name State
----------------------------------------------------
37 fedora24 running
$ virsh -c qemu:///system list --all
Id Name State
----------------------------------------------------
37 fedora24 running
- docker shut off
- kali shut off
- test1 shut off

Stephen Harris
- 44,540
net-list
– ChiseledAbs Aug 03 '16 at 21:13virsh net-list --all
.virsh help
gives a list of all the commands, so things likevirsh help | grep network
produces a list of network related commands;virsh net-list
was one of them, and (just as withvirsh list
) you need--all
to show inactive networks as well. – Stephen Harris Aug 03 '16 at 21:15