[libvirt] virsh/virt-install for dummies

Hi, I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated! Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install: # virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed How to fix this? Perhaps I need to run libvirtd before using virsh??? What frustrates me is that there seems no documentation about this process at libvirt.org at all (?). Final question: I have an old QEMU image. How to "import" it to virsh script? Is there any easy way to do that? Thanks, Jun

On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error: # libvirtd libvir: QEMU error : internal error failed to set bridge forward delay to 0 Failed to autostart network 'default': internal error failed to set bridge forward delay to 0 Thanks, Jun

On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run: virsh --connect qemu:///system capabilities
# libvirtd libvir: QEMU error : internal error failed to set bridge forward delay to 0 Failed to autostart network 'default': internal error failed to set bridge forward delay to 0
This suggests you are missing the 'brctl' command - it is part of the bridge-utils packages Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Aug 15, 2008 at 7:36 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run:
virsh --connect qemu:///system capabilities
# libvirtd libvir: QEMU error : internal error failed to set bridge forward delay to 0 Failed to autostart network 'default': internal error failed to set bridge forward delay to 0
This suggests you are missing the 'brctl' command - it is part of the bridge-utils packages
Then I believe this should be fixed: users should be able to run libvirtd without brctl installed. I can still use QEMU/KVM before on my machine without it, so I find no reason why it stop working now with virt-install. OK, now I install bridge-utils, and run libvirtd. After that, I tried virt-install, but still got error like below: # virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:42:56 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed How to fix this now? Thanks a lot, Jun

On Fri, Aug 15, 2008 at 07:47:32PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:36 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run:
virsh --connect qemu:///system capabilities
Then I believe this should be fixed: users should be able to run libvirtd without brctl installed. I can still use QEMU/KVM before on my machine without it, so I find no reason why it stop working now with virt-install.
There's nothing to fix - this is simply a deployment issue - the default installation we provide sets up a 'default' virtual network which provides guests with a NAT based network connection out of the box which requires bridgeutils. If you don't want to use that then you can remove this default config from /etc/libvirt/qemu/networks. All the QEMU network configs without use of bridge-utils are pretty crap though, hence why we setup this default networking config for people
OK, now I install bridge-utils, and run libvirtd. After that, I tried virt-install, but still got error like below:
How to fix this now?
Debug it with 'virsh' first to make sure the basic functionality is working and then go onto virt-install. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Aug 15, 2008 at 8:02 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:47:32PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:36 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run:
virsh --connect qemu:///system capabilities
Then I believe this should be fixed: users should be able to run libvirtd without brctl installed. I can still use QEMU/KVM before on my machine without it, so I find no reason why it stop working now with virt-install.
There's nothing to fix - this is simply a deployment issue - the default installation we provide sets up a 'default' virtual network which provides guests with a NAT based network connection out of the box which requires bridgeutils. If you don't want to use that then you can remove this default config from /etc/libvirt/qemu/networks. All the QEMU network configs without use of bridge-utils are pretty crap though, hence why we setup this default networking config for people
OK, now I install bridge-utils, and run libvirtd. After that, I tried virt-install, but still got error like below:
How to fix this now?
Debug it with 'virsh' first to make sure the basic functionality is working and then go onto virt-install.
Yes, virsh works well: it returns few pages of xml data. However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine. Could you give some hints to fix this?? Thanks, J # LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso DEBUG: libvirt.c: virInitialize (register drivers) DEBUG: libvirt.c: virConnectOpen (name=(null)) DEBUG: lxc_container.c: lxcContainerAvailable (clone call returned Invalid argument, container support is not enabled) DEBUG: libvirt.c: do_open (Could not probe any hypervisor defaulting to xen:///) DEBUG: libvirt.c: do_open (name "xen:///" to URI components: scheme xen opaque (null) authority (null) server (null) user (null) port 0 path / ) DEBUG: libvirt.c: do_open (trying driver 0 (Test) ...) DEBUG: libvirt.c: do_open (driver 0 Test returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 1 (QEMU) ...) DEBUG: libvirt.c: do_open (driver 1 QEMU returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 2 (Xen) ...) DEBUG: xen_unified.c: xenUnifiedOpen (Trying hypervisor sub-driver) DEBUG: xen_unified.c: xenUnifiedOpen (Trying XenD sub-driver) DEBUG: xen_unified.c: xenUnifiedOpen (Failed to activate a mandatory sub-driver) DEBUG: libvirt.c: do_open (driver 2 Xen returned ERROR) DEBUG: hash.c: virUnrefConnect (unref connection 0x851fc70 xen:/// 1) DEBUG: hash.c: virReleaseConnect (release connection 0x851fc70 xen:///) Mon, 18 Aug 2008 19:23:17 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed

Jun Koi wrote:
On Fri, Aug 15, 2008 at 8:02 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:47:32PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:36 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
Hi,
I am frustrated searching for a quick-start documentation for virsh, just to no avail. Any help is greatly appreciated!
Here is what I did: - Compile and install libvirt, virt-manager, virt-install and virt-viewer from source code. This is done (on Ubuntu 8.04). - Now I want to do install a new VM with QEMU or KVM. I got the below error with virt-install:
# virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 345, in main conn = cli.getConnection(options.connect) File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in getConnection return libvirt.open(connect) File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open if ret is None:raise libvirtError('virConnectOpen() failed') libvirtError: virConnectOpen() failed
How to fix this? Perhaps I need to run libvirtd before using virsh???
I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run:
virsh --connect qemu:///system capabilities
Then I believe this should be fixed: users should be able to run libvirtd without brctl installed. I can still use QEMU/KVM before on my machine without it, so I find no reason why it stop working now with virt-install.
There's nothing to fix - this is simply a deployment issue - the default installation we provide sets up a 'default' virtual network which provides guests with a NAT based network connection out of the box which requires bridgeutils. If you don't want to use that then you can remove this default config from /etc/libvirt/qemu/networks. All the QEMU network configs without use of bridge-utils are pretty crap though, hence why we setup this default networking config for people
OK, now I install bridge-utils, and run libvirtd. After that, I tried virt-install, but still got error like below:
How to fix this now?
Debug it with 'virsh' first to make sure the basic functionality is working and then go onto virt-install.
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom. - Cole

On Mon, Aug 18, 2008 at 9:59 PM, Cole Robinson <crobinso@redhat.com> wrote:
Jun Koi wrote:
On Fri, Aug 15, 2008 at 8:02 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:47:32PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:36 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
On Fri, Aug 15, 2008 at 07:32:48PM +0900, Jun Koi wrote:
On Fri, Aug 15, 2008 at 7:30 PM, Jun Koi <junkoi2004@gmail.com> wrote:
> Hi, > > I am frustrated searching for a quick-start documentation for virsh, > just to no avail. Any help is greatly appreciated! > > Here is what I did: > - Compile and install libvirt, virt-manager, virt-install and > virt-viewer from source code. This is done (on Ubuntu 8.04). > - Now I want to do install a new VM with QEMU or KVM. I got the below > error with virt-install: > > > # virt-install -c qemu:///system --name jeos2 --ram 500 --file > img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso > Fri, 15 Aug 2008 19:19:10 ERROR virConnectOpen() failed > Traceback (most recent call last): > File "/usr/bin/virt-install", line 496, in <module> > main() > File "/usr/bin/virt-install", line 345, in main > conn = cli.getConnection(options.connect) > File "/usr/lib/python2.5/site-packages/virtinst/cli.py", line 92, in > getConnection > return libvirt.open(connect) > File "/usr/lib/python2.5/site-packages/libvirt.py", line 139, in open > if ret is None:raise libvirtError('virConnectOpen() failed') > libvirtError: virConnectOpen() failed > > > > How to fix this? Perhaps I need to run libvirtd before using virsh??? > I tried to run libvirtd to see if that fixes the problem, but got the below error:
Yes, for QEMU you need to have the libvirtd daemon up & running. Before attempting to connect with virt-install, make sure you can connect with virsh, eg as a good test run:
virsh --connect qemu:///system capabilities
Then I believe this should be fixed: users should be able to run libvirtd without brctl installed. I can still use QEMU/KVM before on my machine without it, so I find no reason why it stop working now with virt-install.
There's nothing to fix - this is simply a deployment issue - the default installation we provide sets up a 'default' virtual network which provides guests with a NAT based network connection out of the box which requires bridgeutils. If you don't want to use that then you can remove this default config from /etc/libvirt/qemu/networks. All the QEMU network configs without use of bridge-utils are pretty crap though, hence why we setup this default networking config for people
OK, now I install bridge-utils, and run libvirtd. After that, I tried virt-install, but still got error like below:
How to fix this now?
Debug it with 'virsh' first to make sure the basic functionality is working and then go onto virt-install.
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom.
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it? Thanks a lot, J # LIBVIRT_DEBUG=1 virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso DEBUG: libvirt.c: virInitialize (register drivers) DEBUG: libvirt.c: virConnectOpen (name=qemu:///system) DEBUG: libvirt.c: do_open (name "qemu:///system" to URI components: scheme qemu opaque (null) authority (null) server (null) user (null) port 0 path /system ) DEBUG: libvirt.c: do_open (trying driver 0 (Test) ...) DEBUG: libvirt.c: do_open (driver 0 Test returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 1 (QEMU) ...) DEBUG: libvirt.c: do_open (driver 1 QEMU returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 2 (Xen) ...) DEBUG: libvirt.c: do_open (driver 2 Xen returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 3 (OPENVZ) ...) DEBUG: libvirt.c: do_open (driver 3 OPENVZ returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 4 (LXC) ...) DEBUG: libvirt.c: do_open (driver 4 LXC returned DECLINED) DEBUG: libvirt.c: do_open (trying driver 5 (remote) ...) DEBUG: remote_internal.c: doRemoteOpen (proceeding with name = qemu:///system) DEBUG: libvirt.c: do_open (driver 5 remote returned SUCCESS) DEBUG: libvirt.c: do_open (network driver 0 Test returned DECLINED) DEBUG: libvirt.c: do_open (network driver 1 QEMU returned DECLINED) DEBUG: libvirt.c: do_open (network driver 2 remote returned SUCCESS) DEBUG: libvirt.c: do_open (storage driver 0 Test returned DECLINED) DEBUG: libvirt.c: do_open (storage driver 1 storage returned DECLINED) DEBUG: libvirt.c: do_open (storage driver 2 remote returned SUCCESS) DEBUG: libvirt.c: virConnectGetCapabilities (conn=0x851fb08) Unsupported virtualization type DEBUG: libvirt.c: virConnectClose (conn=0x851fb08) DEBUG: hash.c: virUnrefConnect (unref connection 0x851fb08 qemu:///system 1) DEBUG: hash.c: virReleaseConnect (release connection 0x851fb08 qemu:///system) And here is the output of "virsh -c qemu:///system capabilities": <capabilities> <host> <cpu> <arch>i686</arch> </cpu> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='mips'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-mips</emulator> <machine>mips</machine> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='mipsel'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-mipsel</emulator> <machine>mips</machine> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='sparc'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-sparc</emulator> <machine>sun4m</machine> </arch> </guest> <guest> <os_type>hvm</os_type> <arch name='ppc'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu-system-ppc</emulator> <machine>g3bw</machine> <machine>mac99</machine> <machine>prep</machine> </arch> </guest> </capabilities>

On Mon, Aug 18, 2008 at 9:59 PM, Cole Robinson <crobinso@redhat.com> wrote:
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom.
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it?
Thanks a lot, J
# LIBVIRT_DEBUG=1 virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.i The current virt-install release doesn't pick a useful default for virtualization type: it is just hardcoded to use paravirt. Since your host doesn't have paravirt capabilities it is
Jun Koi wrote: throwing an error. This is fixed upstream: we will default to paravirt only if on a xen host, otherwise we use hvm. You'll need to specify --hvm and --accelerate as cli params if you want to install a kvm guest. Also, use the --debug flag if you want to see more useful output related specifically to what virt-install is doing. - Cole

On Tue, Aug 19, 2008 at 12:00 PM, Cole Robinson <crobinso@redhat.com> wrote:
On Mon, Aug 18, 2008 at 9:59 PM, Cole Robinson <crobinso@redhat.com> wrote:
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom.
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it?
Thanks a lot, J
# LIBVIRT_DEBUG=1 virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.i The current virt-install release doesn't pick a useful default for virtualization type: it is just hardcoded to use paravirt. Since your host doesn't have paravirt capabilities it is
Jun Koi wrote: throwing an error. This is fixed upstream: we will default to paravirt only if on a xen host, otherwise we use hvm.
You'll need to specify --hvm and --accelerate as cli params if you want to install a kvm guest.
Thanks for pointing out this pitfault. I added --hvm and --accelerate to the command, and got the below error. Is it a bug, or smt else? Thanks, J # virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso -v --accelerate --debug Tue, 19 Aug 2008 12:17:18 ERROR list index out of range Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 367, in main domain = guest.bestDomainType(options.accelerate) File "/usr/lib/python2.5/site-packages/virtinst/CapabilitiesParser.py", line 177, in bestDomainType return self.domains[-1] IndexError: list index out of range

Jun Koi wrote:
On Tue, Aug 19, 2008 at 12:00 PM, Cole Robinson <crobinso@redhat.com> wrote:
On Mon, Aug 18, 2008 at 9:59 PM, Cole Robinson <crobinso@redhat.com> wrote:
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom.
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it?
Thanks a lot, J
# LIBVIRT_DEBUG=1 virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.i The current virt-install release doesn't pick a useful default for virtualization type: it is just hardcoded to use paravirt. Since your host doesn't have paravirt capabilities it is
Jun Koi wrote: throwing an error. This is fixed upstream: we will default to paravirt only if on a xen host, otherwise we use hvm.
You'll need to specify --hvm and --accelerate as cli params if you want to install a kvm guest.
Thanks for pointing out this pitfault. I added --hvm and --accelerate to the command, and got the below error. Is it a bug, or smt else?
Thanks, J
# virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso -v --accelerate --debug Tue, 19 Aug 2008 12:17:18 ERROR list index out of range Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 367, in main domain = guest.bestDomainType(options.accelerate) File "/usr/lib/python2.5/site-packages/virtinst/CapabilitiesParser.py", line 177, in bestDomainType return self.domains[-1] IndexError: list index out of range
Hmm, yeah we should check that and throw a more clear error message. However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686. What libvirt version are you using? What virt-install/python-virtinst version are you using? Is kvm installed? What distro are you on? Thanks, Cole

On Tue, Aug 19, 2008 at 12:23:15PM -0400, Cole Robinson wrote:
However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686.
That's perfectly valid. It merely means he's got the qemu-system-x86_64 binary installed on an i686 host. ie QEMU emulating x86_64 arch. Slow as treacle. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Aug 19, 2008 at 12:23:15PM -0400, Cole Robinson wrote:
However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686.
That's perfectly valid. It merely means he's got the qemu-system-x86_64 binary installed on an i686 host. ie QEMU emulating x86_64 arch. Slow as treacle.
Daniel
Right, the caps xml isn't busted because there is a <guest> element for the x86_64 emulator, it's busted because there is _only_ a <domain> element for that emulator. AFAIK every <guest> piece should have at least one <domain> piece so that we know what domain type we can use that emulator for, yet Jun's capabilities have all the qemu emulators listed and only one <domain> element among them. - Cole

On Wed, Aug 20, 2008 at 1:23 AM, Cole Robinson <crobinso@redhat.com> wrote:
Jun Koi wrote:
On Tue, Aug 19, 2008 at 12:00 PM, Cole Robinson <crobinso@redhat.com> wrote:
On Mon, Aug 18, 2008 at 9:59 PM, Cole Robinson <crobinso@redhat.com> wrote:
Yes, virsh works well: it returns few pages of xml data.
However, "virt-install" still has problem like below. It seems to have some thing with Xen? I dont install Xen on my machine.
Could you give some hints to fix this??
Thanks, J
# LIBVIRT_DEBUG=1 virt-install -c qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso
That command line has an error, you need to use --connect for the URI, -c == --cdrom.
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it?
Thanks a lot, J
# LIBVIRT_DEBUG=1 virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.i The current virt-install release doesn't pick a useful default for virtualization type: it is just hardcoded to use paravirt. Since your host doesn't have paravirt capabilities it is
Jun Koi wrote: throwing an error. This is fixed upstream: we will default to paravirt only if on a xen host, otherwise we use hvm.
You'll need to specify --hvm and --accelerate as cli params if you want to install a kvm guest.
Thanks for pointing out this pitfault. I added --hvm and --accelerate to the command, and got the below error. Is it a bug, or smt else?
Thanks, J
# virt-install --connect qemu:///system --name jeos2 --ram 500 --file img.jeos2 --cdrom jeos-8.04.1-jeos-i386.iso -v --accelerate --debug Tue, 19 Aug 2008 12:17:18 ERROR list index out of range Traceback (most recent call last): File "/usr/bin/virt-install", line 496, in <module> main() File "/usr/bin/virt-install", line 367, in main domain = guest.bestDomainType(options.accelerate) File "/usr/lib/python2.5/site-packages/virtinst/CapabilitiesParser.py", line 177, in bestDomainType return self.domains[-1] IndexError: list index out of range
Hmm, yeah we should check that and throw a more clear error message.
However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686.
What libvirt version are you using? What virt-install/python-virtinst version are you using?
I use libvirt-0.4.4-cvs, and virt-install-0.300.3.
Is kvm installed? Yes, but does that really matter? I guess qemu is not even started at this step.
What distro are you on? Ubuntu 8.04, gcc 4.2.3, python 2.5.2
Many thanks, Jun

Jun Koi wrote:
On Wed, Aug 20, 2008 at 1:23 AM, Cole Robinson <crobinso@redhat.com> wrote:
Jun Koi wrote: Hmm, yeah we should check that and throw a more clear error message.
However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686.
What libvirt version are you using? What virt-install/python-virtinst version are you using?
I use libvirt-0.4.4-cvs, and virt-install-0.300.3.
Is kvm installed?
Yes, but does that really matter? I guess qemu is not even started at this step.
Yes it does matter because I am trying to figure out why your capabilities xml is messed up. Here is a piece of the capabilities xml you posted: <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> </arch> <features> ... </features> </guest> This piece here should have a <domain> element, but since it doesn't that means libvirt didn't have executable access to /usr/bin/qemu. Is this named differently on Ubuntu? How about all the other binaries (qemu-system-mips, ...)? <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> ... </features> </guest> If kvm is installed, then this should have a kvm <domain> entry. Is /dev/kvm present/kvm module loaded? Is /usr/bin/qemu-kvm present? Thanks, Cole

On Thu, Aug 21, 2008 at 1:57 AM, Cole Robinson <crobinso@redhat.com> wrote:
Jun Koi wrote:
On Wed, Aug 20, 2008 at 1:23 AM, Cole Robinson <crobinso@redhat.com> wrote:
Jun Koi wrote: Hmm, yeah we should check that and throw a more clear error message.
However, the root cause is that your capabilities xml is screwy (posted a few messages back.) There is only a <domain> element for x86_64 qemu but you're host arch is reported as i686.
What libvirt version are you using? What virt-install/python-virtinst version are you using?
I use libvirt-0.4.4-cvs, and virt-install-0.300.3.
Is kvm installed?
Yes, but does that really matter? I guess qemu is not even started at this step.
Yes it does matter because I am trying to figure out why your capabilities xml is messed up.
Here is a piece of the capabilities xml you posted:
<guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> </arch> <features> ... </features> </guest>
This piece here should have a <domain> element, but since it doesn't that means libvirt didn't have executable access to /usr/bin/qemu. Is this named differently on Ubuntu?
Though I use Ubuntu, I installed KVM from source code. And the vanilla QEMU is not installed. And I use the KVM binary for QEMU (so no accelerator is active in that case) And there is no /usr/bin/qemu, but only /usr/bin/qemu-system-x86_64 in KVM installation.
<guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> ... </features> </guest>
If kvm is installed, then this should have a kvm <domain> entry. Is /dev/kvm present/kvm module loaded? Is /usr/bin/qemu-kvm present?
There is nothing like qemu-kvm anywhere in my box. I guess that is from Fedora package only? (I compiled and installed KVM from source code) Thanks, J

On Tue, Aug 19, 2008 at 11:25:21AM +0900, Jun Koi wrote:
Yes, that was a mistake. I changed -c to --connect, and get the error "Unsupported virtualization type" now. How can I fix it?
I've been bitten by this very same error message in virt-install. Took me absolutely ages to work out that I had to use the '--hvm' option. It's a usability bug in virt-install, plain and simple. Attached is a patch which clarifies the error message. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 60 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
participants (4)
-
Cole Robinson
-
Daniel P. Berrange
-
Jun Koi
-
Richard W.M. Jones