[libvirt] Create a new VM from an existent image?

Hi, To use libvirt, I am strying to use virt-install to create a new VM from an existent (KVM) VM image. I did the following steps: 1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree) 2) Run virt-install (0.400.3) with my existent image in img/img.winxp # virt-install --import -n winxp -f img/img.xp3 --vnc --hvm --accelerate --ram 800 However, this step returns error like: "ERROR Could not find usable default libvirt connection." Actually I am not sure that is the right way to use the new --import option with virt-install. So that might be the problem? All the code are updated, and compiled from source on Ubuntu 8.04. Any help? Thanks a lot, J

Jun Koi wrote:
Hi,
To use libvirt, I am strying to use virt-install to create a new VM from an existent (KVM) VM image. I did the following steps:
1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree)
2) Run virt-install (0.400.3) with my existent image in img/img.winxp
# virt-install --import -n winxp -f img/img.xp3 --vnc --hvm --accelerate --ram 800
That looks fine.
However, this step returns error like:
"ERROR Could not find usable default libvirt connection."
If 'virsh --connect qemu:///system' doesn't work, you probably didn't configure your libvirt install correctly. - Cole
Actually I am not sure that is the right way to use the new --import option with virt-install. So that might be the problem?
All the code are updated, and compiled from source on Ubuntu 8.04. Any help?
Thanks a lot, J

On Fri, Jul 17, 2009 at 10:42 PM, Cole Robinson<crobinso@redhat.com> wrote:
Jun Koi wrote:
Hi,
To use libvirt, I am strying to use virt-install to create a new VM from an existent (KVM) VM image. I did the following steps:
1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree)
2) Run virt-install (0.400.3) with my existent image in img/img.winxp
# virt-install --import -n winxp -f img/img.xp3 --vnc --hvm --accelerate --ram 800
That looks fine.
However, this step returns error like:
"ERROR Could not find usable default libvirt connection."
If 'virsh --connect qemu:///system' doesn't work, you probably didn't configure your libvirt install correctly.
But it works! So the problem stays elsewhere. Do you have any suggestion? Thanks, J
Actually I am not sure that is the right way to use the new --import option with virt-install. So that might be the problem?
All the code are updated, and compiled from source on Ubuntu 8.04. Any help?
Thanks a lot, J

Jun Koi wrote:
On Fri, Jul 17, 2009 at 10:42 PM, Cole Robinson<crobinso@redhat.com> wrote:
Jun Koi wrote:
Hi,
To use libvirt, I am strying to use virt-install to create a new VM from an existent (KVM) VM image. I did the following steps:
1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree)
2) Run virt-install (0.400.3) with my existent image in img/img.winxp
# virt-install --import -n winxp -f img/img.xp3 --vnc --hvm --accelerate --ram 800
That looks fine.
However, this step returns error like:
"ERROR Could not find usable default libvirt connection."
If 'virsh --connect qemu:///system' doesn't work, you probably didn't configure your libvirt install correctly.
But it works! So the problem stays elsewhere.
Do you have any suggestion?
Hmm, then you probably need this patch to virtinst, since our URI detection likely isn't as thorough as libvirt: http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virtinst--devel/rev... - Cole

On Sun, Jul 19, 2009 at 1:59 AM, Cole Robinson<crobinso@redhat.com> wrote:
Jun Koi wrote:
On Fri, Jul 17, 2009 at 10:42 PM, Cole Robinson<crobinso@redhat.com> wrote:
Jun Koi wrote:
Hi,
To use libvirt, I am strying to use virt-install to create a new VM from an existent (KVM) VM image. I did the following steps:
1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree)
2) Run virt-install (0.400.3) with my existent image in img/img.winxp
# virt-install --import -n winxp -f img/img.xp3 --vnc --hvm --accelerate --ram 800
That looks fine.
However, this step returns error like:
"ERROR Could not find usable default libvirt connection."
If 'virsh --connect qemu:///system' doesn't work, you probably didn't configure your libvirt install correctly.
But it works! So the problem stays elsewhere.
Do you have any suggestion?
Hmm, then you probably need this patch to virtinst, since our URI detection likely isn't as thorough as libvirt:
http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virtinst--devel/rev...
I got the latest code from hg tree, and installed that. But running "virt-install" (without option) returns the error message: Traceback (most recent call last): File "/usr/local/bin/virt-install", line 36, in <module> from virtinst.VirtualCharDevice import VirtualCharDevice ImportError: No module named VirtualCharDevice How to fix this problem? Thanks, J
participants (2)
-
Cole Robinson
-
Jun Koi