Results 1 to 2 of 2

Thread: vmbuilder python error during kvm guest creation

  1. #1
    Join Date
    Apr 2011

    vmbuilder python error during kvm guest creation

    Ubuntu Server 10.10 with updates
    kernel KVM enabled

    I have been trying to create a KVM guest using vmbuilder. It gets to the deploy section and dies with a python error. I have searched all over and all I find are links to old bugs. KVM cannot be broken on 10.10. What can I be doing wrong? Pointers greatly appreciated.

    vmbuilder script:

    # ubuntu-vm-builder script for sss.ddd.ddd
    ubuntu-vm-builder kvm maverick -o \
    --domain sss.ddd.ddd \
    --dest /disk1/Virtual_Machines/sss \
    --arch amd64 \
    --hostname sss \
    --mem 4096 \
    --user dummy \
    --pass password \
    --ip xxx.xx.xx.xx \
    --mask \
    --net xxx.xx.xx.xx \
    --bcast xxx.xx.xx.xx \
    --gw xxx.xx.xx.xx \
    --dns yyy.yyy.y.yy \
    --components main, universe \
    --addpkg acpid \
    --addpkg vim \
    --addpkg openssh-server \
    --addpkg avahi-daemon \
    --libvirt qemu:///system ;

    The error (transcribed, may have typos)

    Calling hook: deploy
    libvir: Remore error : server closed connection:
    Traceback (most recent call last):
    File "/usr/bin/ubuntu-vm-builder", line 24, in <module>
    File "/usr/lib/python2.6/dist-packages/VMBuilder/contrib/", line 121, in main
    File "/usr/lib/python2.6/dist-packages/VMBuilder/", line 78, in
    finalise hooks('deploy', destdir)
    File "/usr/lib/python2.6/dist-packages/VMBuilder/, line 66 in
    call_hooks(self, *args, **kwargs)
    File "/usr/lib/python2.6/dist-packages/VMBuilder/", line 158, in
    getattr(plugin, func, log_no_such_method))(*args, **kwargs)
    File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/libvirt/", line 83, in deploy
    File "/usr/lib/python2.6/dist-packages/", line 1299, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML()failed', conn=self)
    libvirt.libvirtError: server closed connection:

    Thanks for any help.


  2. #2
    Join Date
    Sep 2008

    Re: vmbuilder python error during kvm guest creation

    The error you are seeing happens when the virbr0 (or whatever the name in your case is, is in use.) I found this out by trial and error.

    So in effect to use ubuntu-vm-builder you have to allow your other KVM guests to be offline for a moment. There are other ways to create a KVM guest, which maybe allow you to keep the existing guests running, but I have not used those.

    To solve your problem, type

    sudo ifconfig virbr0 down

    Then you need to restart your networking:

    sudo /etc/init.d/networking restart
    You can do this even if you are connected to a remote server, it should come right up and keep your connection open to the remote server.

    Now check if the virbr0 is gone:

    (sudo not needed because you just look at the info)

    If the virbr0 is still there, you need to find out what brings it up again: KVM networking on autostart or maybe you have it in your /etc/network/interfaces -file. But to be able to create a KVM virtual machine useing ubuntu-vm-builder you cannot have it on.

    Also make sure you have libvirt-bin on. Try
    sudo /etc/init.d/libvirt-bin stop
    sudo /etc/init.d/libvirt-bin stop
    Mere restart will not do the trick for some eason - apparently there needs to be at least some periods for the OS to do whatever it needs to do in between the start and stop.

    You also neet to make sure you are not trying to overwrite an existing KVM guest.
    Check the defined guests with
    virsh -c qemu:///system list
    and if you have existing guest with the same name and you know that you want to get rid of it, then
    virsh undefine [name]
    Hope this helps.

    Last edited by sunpower; June 7th, 2011 at 09:52 AM.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts