Re: How to configure the default connection for virsh

2024-04-18 Thread Nir Soffer
On Thu, Apr 18, 2024 at 5:20 PM Daniel P. Berrangé 
wrote:

> On Thu, Apr 18, 2024 at 05:07:24PM +0300, Nir Soffer wrote:
> > We are using minikube vms, which require adding the user to to libvirt
> > group[1].
> > We use `virsh -c qemu:///system` for debugging these vms or related
> libvirt
> > networks.
> >
> > Using virsh without specifying the '-c' argument is a common mistake that
> > leads to
> > trouble, for example creating the libvirt default network incorrectly.
> >
> > I wonder if it is possible to configure virsh so it uses -c
> qemu:///system
> > by default?
>
> The $HOME/.config/libvirt/libvirt.conf client config file can contain
>
>uri_default = "qemu:///system"
>
> Or you can set per shell with
>
>export LIBVIRT_DEFAULT_URI=qemu:///system
>
> Or you can set it just for virsh with
>
>export VIRSH_DEFAULT_CONNECT_URI=qemu:///system
>
> See:
>
>   https://libvirt.org/uri.html#default-uri-choice
>   https://libvirt.org/manpages/virsh.html#environment
>
>
Awesome, thanks!
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org


Re: How to configure the default connection for virsh

2024-04-18 Thread Daniel P . Berrangé
On Thu, Apr 18, 2024 at 05:07:24PM +0300, Nir Soffer wrote:
> We are using minikube vms, which require adding the user to to libvirt
> group[1].
> We use `virsh -c qemu:///system` for debugging these vms or related libvirt
> networks.
> 
> Using virsh without specifying the '-c' argument is a common mistake that
> leads to
> trouble, for example creating the libvirt default network incorrectly.
> 
> I wonder if it is possible to configure virsh so it uses -c qemu:///system
> by default?

The $HOME/.config/libvirt/libvirt.conf client config file can contain

   uri_default = "qemu:///system"

Or you can set per shell with 

   export LIBVIRT_DEFAULT_URI=qemu:///system

Or you can set it just for virsh with

   export VIRSH_DEFAULT_CONNECT_URI=qemu:///system

See:

  https://libvirt.org/uri.html#default-uri-choice
  https://libvirt.org/manpages/virsh.html#environment

With regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org