-----Original Message-----
From: Shawn Davis [mailto:sdavis17@hawk.iit.edu]
Sent: Monday, March 26, 2012 12:56 PM
To: 'Eric Blake'
Cc: 'Alex Jia'; 'libvirt-users(a)redhat.com'
Subject: RE: [libvirt-users] qemu-monitor-command
-----Original Message-----
From: Eric Blake [mailto:eblake@redhat.com]
Sent: Monday, March 26, 2012 9:18 AM
To: Shawn Davis
Cc: 'Alex Jia'; libvirt-users(a)redhat.com
Subject: Re: [libvirt-users] qemu-monitor-command
On 03/24/2012 10:15 AM, Shawn Davis wrote:
Sorry for the noob question but how do I configure and build qemu-kvm
and libvirt so that they are all installed in the correct places? Is
there a specific flag I need to use or do I need to install them from
a specific directory? It looks like the files and being put all over
the place. Some are in /etc and some are in /usr/local/etc. If I can
get everything to install in the correct spots I should be good I would
hope.
What arguments are you passing to ./configure? If you build from
libvirt.git and are on a Fedora-based system, then using ./autogen.sh
--system will set up the preferred arguments to configure (these include
--prefix=/usr --libdir=$prefix/$lib --sysconfdir=/etc --localstatedir=/var,
where $lib is either lib or lib64).
I'm not quite sure what default directories a debian-based install prefers;
patches are welcome to ./autogen.sh to account for any differences to match
debian-preferred layout.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org
I reinstalled my Ubuntu 11.10 Desktop OS again and I will run you through
exactly what I had done prior to your last reply:
QEMU
1. I downloaded qemu-kvm from here:
http://sourceforge.net/projects/kvm/files/qemu-kvm/1.0/
2. I extracted it to my home folder called testa
3. sudo apt-get install zlib1g-dev libglib2.0-dev as I know those are
needed dependencies on this system
4. ./configure --prefix=/usr
5. make, then sudo make install
6. I looked and qemu-system-x86_64 is located in /usr/bin
7. From /usr/bin the command qemu-kvm-x86_64 --version gives me "QEMU
emulator version 1.0"
8. I run sudo ./qemu-system-x86_64 which says could not access KVM
kernel module, failed to init KVM, no accelerator found.
9. I run sudo /sbin/modprobe kvm-intel
10. I run sudo ./qemu-system-x86_64 again which now brings up "VNC
server running on "127.0.0.1:5900' I cntl-c out of that.
Libvirt
11. I downloaded libvirt-0.9.10.tar.gz from
libvirt.org/sources/ and
extract it to my home folder.
12. sudo apt-get install libxml2.dev gnutls-bin gnutls-dev
libdevmapper-dev libdevmapper python-dev libnl1 libnl-dev libyajl-dev as I
know those dependencies are needed.
13. ./configure --prefix=/usr
14. make, then sudo make install
15. which virsh gives me: /usr/bin/virsh
16. which libvirtd give me: /usr/sbin/libvirtd
17. I run sudo virsh version and get "Failed to reconnect to the
hypervisor, no valid connection, failed to connect socket to
/var/run/libvirt/libvirt-sock: no such file or directory.
18. I look in /var/run/libvirt and there is no libvirt-sock in there.
19. libvirtd --version returns libvirtd (libvirt) 0.9.10
20. sudo libvirtd start or restart returns libvirtd: unrecognized
service.
21. sudo ./libvirtd -d
22. I again run sudo virsh version which returns:
Copiled again library: libvir 0.9.10
Using library: libvir 0.9.10
Using API: QEMU 0.9.10
Running hypervisor: QEMU 1.0.0
Virt-Install
23. I run sudo apt-get virtinst
HERE IS WHERE I RUN INTO SOME PROBLEMS:
24. virtinst starts installing and I eventually get this:
Configuration file /etc/logrotate.d/libvirtd
File on system created by you or by a script.
File also in package provided by package maintainer
What would you like to do about it? Your options are:
Y : install the package maintainer's version
N : keep your currently-installed version
25. I also get the same message for /etc/libvirt/libvird.conf,
/etc/libvirt/lxc.conf, /etc/libvirt/nwfiler/clean-traffic.xml,
/etc/libvirt/nwfilter/no-arp-spoofing.xml,
/etc/libvirt/nwfilter/no-ip-spoofing.xml,
/etc/libvirt/nwfilter/no-mac-spoofing.xml,
/etc/libvirt/qemu/networks/default.xml, and /etc/libvirt/qemu.conf.
26. The first time I got to this point, I chose the N: keep your
currently-installed version on all of those.
27. Then when I tried to do sudo virsh version, I got: virsh:
/usr/lib/libvirt.so.0: version 'LIBVIRT_PRIVATE_0.9.2' not found (required
by virsh)
28. I tried to restart libvirtd and is returned the same error msg.
29. This time I went through all of the steps and when I got to my step
24, I chose Y : install the package maintainer's version.
30. I got the same LIBVIRT_PRIVATE.... msg again when trying to run sudo
virsh version.
31. I ran sudo ./libvirtd -d from the /usr/sbin location and received
the same LIBVIRT_PRIVATE error message.
So it looks like I can get QEMU and LIBVIRT installed from source okay but
when I try to install virtinst in order to create my vm, I run into
problems. Thoughts? Thanks!
I got everything working and was able use the qemu-monitor-command with
pmemsave now that I have the latest versions of qemu and libvirt. Thanks
for all of the help! One last question on this. When I reboot, I get
errors and virsh doesn't see the hypervisor anymore and I am unable to start
libvirtd again. While I have everything running now, what can I do to
ensure libvirtd will start on reboot? Initially to start it I have to run
sudo ./libvirtd -d from the /usr/sbin location. That doesn't work on reboot
though for some reason. I noticed some people have libvirtd in their init.d
folder but mine doesn't get put there with the installation I am doing.