[libvirt] Libvirt Auth

Matthias Bolte matthias.bolte at googlemail.com
Wed Mar 3 18:03:41 UTC 2010

2010/3/3 Marco Mornati <mmornati at byte-code.com>:
> Hello guys,
> I've created a plugin for Hudson (CI) to manage virtmachines using libvirt
> java (start vm for a build and stop just after).
> I've just a problem in authentication, in fact I cannot send uname and
> password using code, libvirt ask me for the credentials on CLI. someone
> could explain me How I can use authentican or where I can find an usage
> guide or example?
> Thanks a lot
> Bye
> Marco

You have to use virConnectOpenAuth to open a connection and provide an
authentication callback.

I have no Java example at hand but you can look at the
examples/python/esxlist.py Python script for an example how to provide
an authentication callback.

Also see the ConnectAuth and ConnectAuthDefault classes in the Java bindings.


More information about the libvir-list mailing list