On 12/01/2015 10:31 AM, Andrei Perietanu wrote:
Hi all,
I think I might have a small configuration issue: after restarting
my machine, all the VMs previously installed are not available.
virsh list --all shows an empty list.
1) Are you running virsh as root?
2) How did you create the guests? Did you use virt-install or virsh
define? Or maybe you're using "virsh create"? (the latter would create a
transient guest, whose configuration would exist only until the guest
was terminated).
The .img files where the VMs were intalled are present in the folder
I
put them in. Furthermore if I import the VMs (virt-install -import) it
all seems to work. It's just that I don't want to have to do this
after every restart and can't find where libvirt picks up information
about any existing VMs on the system.
It all depends on whether or not you were running as root when you
created the guests. If you were running as root, virsh/virt-install
would have connected to qemu:///system, and the config for the guest is
stored in /etc/libvirt/qemu. If you were running as an unprivileged
user, virsh/virt-install would connect to qemu:///session (an instance
of libvirtd specific to the current user), and the configuration for the
guests would be in ~/.config/libvirt/qemu.
Note that you should *never* directly examine or modify these files, as
their existence is not a part of the official libvirt API; you should
instead use virsh, virt-manager, or some other management application
that uses the libvirt API. I am only telling you this information so
that you can do a sanity check on the files' existence/location.