[libvirt-users] how to use libvirt

Hi everyone: I am just a new user to libvirt. I installed libvirt as: ./configure make sudo make After that I run the program in the development guide. But it seems that the program is stuck in the function of virConnectOpenReadOnly. When I tried the command: virsh list --all, it is also stuck. So could anyone tell me what's wrong with this? Thank you so much Tianwei Zhang

On 01/06/2013 09:14 PM, tianwei zhang wrote:
Hi everyone:
I am just a new user to libvirt. I installed libvirt as:
./configure make sudo make
Did you mean 'sudo make install' here?
After that I run the program in the development guide.
Which guide? Having a URL to the guide you were following will help us know whether we can improve that guide to make it easier to use.
But it seems that the program is stuck in the function of virConnectOpenReadOnly. When I tried the command: virsh list --all, it is also stuck. So could anyone tell me what's wrong with this?
It may be easier to use a pre-built version from your distro, as that will eliminate the possibility of user error in building your package until you are more familiar with using libvirt. Beyond that, you didn't give us much to go on - it is not obvious whether libvirtd is running, or whether you ran 'virsh' as root or as a normal user, or even what is in the log files, so it could be a number of problems. Does this page help? http://wiki.libvirt.org/page/Troubleshooting -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hi Eric: Yes, I mean sudo make install. What I installed the libvirt on ubuntu is as below: ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make sudo make install. after installation, I try to start the libvirtd and the error is: service libvirtd start libvirtd: unrecognized service Also when I type: virsh list --all: error: Failed to reconnect to the hypervisor error: no valid connection error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory So what's wrong with that? Thank you so much Tianwei On Mon, Jan 7, 2013 at 11:00 AM, Eric Blake <eblake@redhat.com> wrote:
On 01/06/2013 09:14 PM, tianwei zhang wrote:
Hi everyone:
I am just a new user to libvirt. I installed libvirt as:
./configure make sudo make
Did you mean 'sudo make install' here?
After that I run the program in the development guide.
Which guide? Having a URL to the guide you were following will help us know whether we can improve that guide to make it easier to use.
But it seems that the program is stuck in the function of virConnectOpenReadOnly. When I tried the command: virsh list --all, it is also stuck. So could anyone tell me what's wrong with this?
It may be easier to use a pre-built version from your distro, as that will eliminate the possibility of user error in building your package until you are more familiar with using libvirt. Beyond that, you didn't give us much to go on - it is not obvious whether libvirtd is running, or whether you ran 'virsh' as root or as a normal user, or even what is in the log files, so it could be a number of problems.
Does this page help? http://wiki.libvirt.org/page/Troubleshooting
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
-- Tianwei Zhang Department of Electrical Engineering Princeton University NJ, USA

On 09.01.2013 07:22, tianwei zhang wrote:
Hi Eric:
Yes, I mean sudo make install.
What I installed the libvirt on ubuntu is as below:
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make sudo make install.
after installation, I try to start the libvirtd and the error is:
service libvirtd start libvirtd: unrecognized service
I don't know what your init daemon is, but you need to tell configure which style of init script you want to install: ./configure --with-init-script=systemd or whatever you are using. See ./configure --help for more info on this.
Also when I type:
virsh list --all: error: Failed to reconnect to the hypervisor error: no valid connection error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
So what's wrong with that?
This is the result of libvirtd not running.
Thank you so much
Tianwei
Michal

On 01/08/2013 11:22 PM, tianwei zhang wrote:
Hi Eric:
[please don't top-post on technical lists]
Yes, I mean sudo make install.
What I installed the libvirt on ubuntu is as below:
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make sudo make install.
after installation, I try to start the libvirtd and the error is:
service libvirtd start libvirtd: unrecognized service
Merely running 'make install' does NOT register libvirtd as a system service. For that, you need additional steps, such as those encoded in libvirt.spec.in: %if %{with_systemd} %if %{with_systemd_macros} %systemd_post libvirtd.service %else if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl enable virtlockd.socket >/dev/null 2>&1 || : /bin/systemctl enable libvirtd.service >/dev/null 2>&1 || : fi %endif %else %if %{with_cgconfig} # Starting with Fedora 16/RHEL-7, systemd automounts all cgroups, # and cgconfig is no longer a necessary service. %if (0%{?rhel} && 0%{?rhel} < 7) || (0%{?fedora} && 0%{?fedora} < 16) if [ "$1" -eq "1" ]; then /sbin/chkconfig cgconfig on fi %endif %endif /sbin/chkconfig --add libvirtd if [ "$1" -ge "1" ]; then /sbin/service libvirtd condrestart > /dev/null 2>&1 fi %endif That is why we suggest that you install the pre-built libvirt from your distro, before then trying to self-install, if you want to take advantage of all the work your distro has done in hooking up libvirtd into your system's normal scheme of services. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Michal Privoznik
-
tianwei zhang