LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 11-04-2012, 05:40 AM   #1
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Rep: Reputation: Disabled
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?
 
Old 11-05-2012, 04:30 PM   #2
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
Maybe installing libvirt overwrote your custom KVM?
 
Old 11-05-2012, 05:57 PM   #3
guardian1
LQ Newbie
 
Registered: May 2012
Posts: 19

Rep: Reputation: Disabled
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.
 
Old 11-05-2012, 07:43 PM   #4
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
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.
Code:
 dpkg -S libvirt0
Also, it's possible the VMM is running a different QEMU binary. Where did you install your modified QEMU?
 
Old 11-05-2012, 07:49 PM   #5
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-05-2012, 07:52 PM   #6
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
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?
 
Old 11-06-2012, 05:10 AM   #7
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
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?
 
Old 11-06-2012, 07:54 AM   #8
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
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:
Code:
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:
Code:
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.
 
Old 11-06-2012, 09:29 AM   #9
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-06-2012, 11:49 AM   #10
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
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?
 
Old 11-07-2012, 05:18 AM   #11
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Just did a command line launch using the /bin/usr/X11/kvm option, and its the modified KVM, so no joy there either.
 
Old 11-07-2012, 08:01 AM   #12
hunternet93
Member
 
Registered: Jun 2009
Posts: 87

Rep: Reputation: 31
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.
 
Old 11-07-2012, 12:02 PM   #13
essential1
LQ Newbie
 
Registered: May 2012
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks for your help. If I solve the problem I'll update the thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which version kvm/libvirt on which distros? Nick_C Linux - Virtualization and Cloud 11 03-07-2012 11:14 AM
LXer: Scripting KVM with Python, Part 2: Add a GUI to manage KVM with libvirt and Python LXer Syndicated Linux News 0 01-17-2012 09:11 PM
CentOS 6 libvirt KVM Live Snapshot is Slow bjl Linux - Virtualization and Cloud 7 11-03-2011 02:43 PM
KVM administration through LibVirt from windows machine Mohan.Sundar Linux - Virtualization and Cloud 3 05-03-2011 12:31 PM
LXer: Set up Ubuntu 11.04 KVM to run is spice session on Fedora 14 KVM Server ( Libvirt Preview Env) LXer Syndicated Linux News 0 03-20-2011 01:00 AM


All times are GMT -5. The time now is 07:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration