[libvirt-users] Setting the default Hypervisor

Hi all, I'm using libvirt with qemu-kvm and virtualbox on the same system. Everything is working, but I want to change the default uri fo virsh. At the moment, if i run: # virsh uri vbox:///system and because of this, if I try to list my vm(s) in this way: # virsh list --all Id Name State ---------------------------------- the output is empty. I need always to pass the uri: # virsh -c qemu:///system list --all Id Name State ---------------------------------- - ubuntu-vm shut off So, is there a way to set the default uri to be qemu:///system? I looked into /etc/default/libvirt-guests and /etc/default/libvirt-bin but I was not able to find an options (setting URIS= does not work). I'm on Debian Squeeze with backports. Thanks a lot, -- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org

On Thu, Mar 08, 2012 at 01:00:03PM +0100, RaSca wrote:
Hi all, I'm using libvirt with qemu-kvm and virtualbox on the same system. Everything is working, but I want to change the default uri fo virsh. At the moment, if i run:
# virsh uri vbox:///system
and because of this, if I try to list my vm(s) in this way:
# virsh list --all Id Name State ----------------------------------
the output is empty. I need always to pass the uri:
# virsh -c qemu:///system list --all Id Name State ---------------------------------- - ubuntu-vm shut off
So, is there a way to set the default uri to be qemu:///system? I looked into /etc/default/libvirt-guests and /etc/default/libvirt-bin but I was not able to find an options (setting URIS= does not work).
Set the following env export LIBVIRT_DEFAULT_URI=qemu:///system We support a config home $HOME/.libvirt/libvirt.conf for setting up URI aliases, but we don't currently support setting the defautl URI via the config file. If you file a BZ, we can easily fix that omission Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Il giorno Gio 08 Mar 2012 13:06:41 CET, Daniel P. Berrange ha scritto: [...]
Set the following env export LIBVIRT_DEFAULT_URI=qemu:///system We support a config home $HOME/.libvirt/libvirt.conf for setting up URI aliases, but we don't currently support setting the defautl URI via the config file. If you file a BZ, we can easily fix that omission Regards, Daniel
Thank you Daniel, it works. What I don't understand is who originally set the URI default value. My Installation step where first installing virtualbox and then libvirt with qemu-kvm. It was some apt-get post script that read from the system the virtualbox installation and then sets the executable? The point is: where does this value stored? Is it hardcoded somewhere? Thanks a lot, -- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org

On Thu, Mar 08, 2012 at 02:15:49PM +0100, RaSca wrote:
Il giorno Gio 08 Mar 2012 13:06:41 CET, Daniel P. Berrange ha scritto: [...]
Set the following env export LIBVIRT_DEFAULT_URI=qemu:///system We support a config home $HOME/.libvirt/libvirt.conf for setting up URI aliases, but we don't currently support setting the defautl URI via the config file. If you file a BZ, we can easily fix that omission Regards, Daniel
Thank you Daniel, it works. What I don't understand is who originally set the URI default value. My Installation step where first installing virtualbox and then libvirt with qemu-kvm. It was some apt-get post script that read from the system the virtualbox installation and then sets the executable?
The point is: where does this value stored? Is it hardcoded somewhere?
No, libvirt just probes each of its hypervisor drivers in turn, until it finds out that claims to work Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Il giorno Gio 08 Mar 2012 14:31:38 CET, Daniel P. Berrange ha scritto: [...]
No, libvirt just probes each of its hypervisor drivers in turn, until it finds out that claims to work Daniel
Ok, but even if I stop the virtualbox service (even with all processes and modules unloaded) libvirt find it first. Is it correct? -- RaSca Mia Mamma Usa Linux: Niente è impossibile da capire, se lo spieghi bene! rasca@miamammausalinux.org http://www.miamammausalinux.org
participants (2)
-
Daniel P. Berrange
-
RaSca