KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

What are the relation between VMM(Virtual Machine Manager), libvirt and KVM ?

3 replies [Last post]
sw2wolf
Offline
Joined: Mar 18 2009
Points: 29

I have used KVM since kvm-7x and now i am using KVM-86(as i cannot compile KVM-88). However, i have never used VMM and libvirt !

I use KVM as below:

%/usr/local/bin/qemu-system-x86_64 -m 256 -soundhw es1370 -hda /media/E/winxp.img -hdb /dev/sda7 -localtime -net nic -net user -nographic -daemonize -redir tcp:3389::3389 -boot c -k en-us &

%rdesktop localhost:3389 -u sw2wolf -p 123 -g 1440x880 -D -K -r sound:remote

It works fine ! So i donot understand why we need VMM and libvirt ?

Any suggestions are appreciated !

Haydn Solomon
Offline
Joined: Mar 7 2008
Points: 458
Re: relation between kvm, vmm and libvirt

VMM and libvirt and do the same things as you do now managing kvm by command line. Together, they just provide a GUI front end that makes it easier to manage your guests.

Libvirt provides a daemon service that manages your kvm processes. It starts, stops, pauses and can do some things as you normally would using the monitor commands but not everything. So libvirt is one layer above the kvm process. VMM (Virtual Machine manager) is a GUI front end that sends instructions via a libvirt client to libvirt daemon(s) to perform operations on the kvm process that it is are managing. VMM therefore sits a little farther away from the kvm process. So you have

VMM -----> libvirtclient----> libvirtd ------> kvm process

Libvirt daemon service and kvm processes live on the same server. VMM and libvirt client work together and also live on the same machine. The VMM/libvirt client pair can exist on the same or different machine as the libvirt daemon/kvm pair.

Hope this helps..

sw2wolf
Offline
Joined: Mar 18 2009
Points: 29
It is clear now! thanks!

It is clear now! thanks!

Manisha (not verified)
libvirtd deamon hangs after Guest VM shutdown

I have couple of guest VM created on my Rhel6 machine .I am using virsh commands to start and shutdown the guest VM. When i shutdown guest VM using :
virsh shutdown "domain-name" , it shutdowns the guest properly . But after that if i run "virsh list" , the command hangs . I tried to run the strace on that process. It hangs at polling the data from /var/run/libvirt/libvirt-sock.
libvirtd maintains domain_name.pid and domain_name.xml to store process id of the qemu emulator which is running the guest VM and the xml file to store guest information . The xml file also stores the current status of the guest VM. On guest shutdown these files should get deleted. But in my case the even after guest shutdown these files exists and xml file shows guest VM running.

As i understand , libvirt client and libvirtd (server) communicates using this socket (/var/run/libvirt/libvt-sock). When libvirtd asks for guest VM status , libvirt client should reply by writing to the socket. But in my case i guess libvirt client is not responding and libvirtd is just waiting infinitely for the response.

Could anyone please suggest , when guest VM shuts down how does libvirt client knows about it and what reply it sends to libvirtd about the guest shutdown ?

Thanks,
-Manisha

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.