-   Linux - Virtualization and Cloud (
-   -   Modified kvm does not work the same after installing libvirt (

essential1 11-04-2012 04:40 AM

Modified kvm does not work the same after installing libvirt
Hi all,

I have a modified KVM-QEMU which launches a script at a given point within its running. It worked well, until I installed libvirt and virtual machine manager, after which the script did not launch.

I can't figure out why installing libvirt would make a change to KVM-QEMU. Surely libvirt would not interfere with the way the code flows within KVM, because that is the only explanation for why the script is never launched after I install libvirt? Any thoughts please?

hunternet93 11-05-2012 03:30 PM

Maybe installing libvirt overwrote your custom KVM?

guardian1 11-05-2012 04:57 PM

Does installing libvirt do that? When I installed libvirt via apt-get I only told it to install libvirt and VMM. I wanted to utilise some of the libvirt features but I'm going to have to forget about them for the moment.

hunternet93 11-05-2012 06:43 PM

I don't know if libvirt would overwrite the package or not. You could run the command below to see what files the package installed.

dpkg -S libvirt0
Also, it's possible the VMM is running a different QEMU binary. Where did you install your modified QEMU?

essential1 11-05-2012 06:49 PM

The command you suggested returns this output:

libvirt0: /usr/share/doc/libvirt0/copyright
libvirt0: /usr/share/doc/libvirt0/TODO
libvirt0: /usr/share/doc/libvirt0/AUTHORS.gz
libvirt0: /usr/share/doc/libvirt0/changelog.Debian.gz
libvirt0: /usr/share/doc/libvirt0/NEWS.gz
libvirt0: /usr/share/doc/libvirt0/README
libvirt0: /usr/share/doc/libvirt0

As for the installation of kvm-qemu, i installed it at /usr/local/kvm
I start virtual machines at the command line by using an example command like the following:

sudo /usr/local/kvm/bin/qemu-system-x86_64 vm.img -m 2048

hunternet93 11-05-2012 06:52 PM

Maybe VMM is using /usr/bin/kvm instead of /usr/bin/local/kvm? Or do you see the issue even when running your modified kvm directly?

essential1 11-06-2012 04:10 AM

Using the modified VM from command line works in the way I expect.

VMM does not provide details of how it launches KVM, only that it links to qemu:///system.

However I just launched from the location you mentioned (which I didn't know existed), and it didn't work like the modified KVM. What are my options? If I installed a modified KVM why would it have a link to the unmodified KVM in /usr/bin?

hunternet93 11-06-2012 06:54 AM

What happened: You have two copies of KVM-QEMU installed: the one you modified in /usr/local/bin, and the one Debian installed in /usr/bin. VMM is starting Debian's version and not your modified binary.

You have a couple options:
1. Start VMM with a $PATH variable that tells VMM to look in /usr/local for KVM before it looks in /usr:

PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin" (insert command to start VMM here)
This would be the preferred solution, but you could also do:
2. Put your modified kvm in /usr/bin:

mv /usr/bin/kvm /usr/bin/kvm-old
cp /usr/local/bin/kvm /usr/bin/kvm

The downside of this approach is that if kvm ever receives an update, your modified kvm will be overwritten.

essential1 11-06-2012 08:29 AM

Unfortunately neither of those have worked, although it did seem to me like you had the right solution - for which I thank you. I tried both attempts, but the modified KVM definitely did not start.

I'm surprised because even after confirming that changing the binaries was working properly (tested by launching KVM from /usr/bin/kvm with the command line), using with VMM did not. I found within VMM that it does indeed use the binary at /usr/bin/kvm which makes it extra confusing.

Not sure how it continues to operate the old one if it now points to the modified KVM. I'd appreciate any more suggestions you might have.

hunternet93 11-06-2012 10:49 AM

It looks like there is also a copy of kvm in /usr/bin/X11, maybe it's running that one. Handy tip: You can use the "whereis" command to find where a program or file is located. Typing "whereis kvm" will show all the files (or directories) name "kvm" are. Out of curiosity, what does your modified KVM do? Your original post says it calls a script, care to elaborate?

essential1 11-07-2012 04:18 AM

Just did a command line launch using the /bin/usr/X11/kvm option, and its the modified KVM, so no joy there either.

hunternet93 11-07-2012 07:01 AM

You could try contacting the people in charge of Virtual Machine Manager, they'd know better that I would what's happening and how to get VMM to run the correct binary.

essential1 11-07-2012 11:02 AM

Thanks for your help. If I solve the problem I'll update the thread.

All times are GMT -5. The time now is 08:05 AM.